MySQL Forums
Forum List  »  Quality Assurance

Help with MySQL Query.
Posted by: Jyothi E
Date: March 20, 2012 12:25PM

I need to write a MySQL query which gives me the names of students who performance in every subject is better than the previous and previous test results are better than the one before it.

The sample table is pasted below, which illustrates Susan's results, she has improved in every subject successively.

I need to write a query for the same.

NAME | DATE | MATHS | SOCIAL | SCIENCE |LANGUAGE |COMPUTERS
----- |-------------|--------|--------|---------|---------|---------
John | 2012-03-10 | 8 | 6 | 5 | 5 | 5
--------------------------------------------------------------------
Mary | 2012-03-10 | 7 | 4 | 7 | 6 | 5
--------------------------------------------------------------------
Susan | 2012-03-10 | 6 | 5 | 4 | 5 | 6
--------------------------------------------------------------------
John | 2012-03-09 | 7 | 6 | 5 | 6 | 6
--------------------------------------------------------------------
Mary | 2012-03-09 | 5 | 6 | 6 | 6 | 6
--------------------------------------------------------------------
Susan | 2012-03-09 | 8 | 7 | 5 | 7 | 6
--------------------------------------------------------------------
John | 2012-03-08 | 8 | 5 | 6 | 5 | 6
--------------------------------------------------------------------
Mary | 2012-03-08 | 7 | 7 | 5 | 7 | 5
--------------------------------------------------------------------
Susan | 2012-03-08 | 9 | 8 | 7 | 8 | 7
--------------------------------------------------------------------

Options: ReplyQuote


Subject
Views
Written By
Posted
Help with MySQL Query.
2121
March 20, 2012 12:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.