Recently posted this question: SQL query comparing an attribute in multiple tuples based on values of another attribute within the relation
The table below is the same but with a slight modification:
Test
+--------+--------+--------+--------+
| Name | Date |Location| Score |
+--------+--------+--------+--------+
| Steven |03-05-12| 120000 | 78 |
+--------+--------+--------+--------+
| James |04-09-11| 110000 | 67 |
+--------+--------+--------+--------+
| James |06-22-11| 110000 | 58 |
+--------+--------+--------+--------+
| Ryan |10-11-13| 250000 | 62 |
+--------+--------+--------+--------+
| Ryan |12-19-13| 180000 | 55 |
+--------+--------+--------+--------+
| Ryan |01-20-15| 180000 | 99 |
+--------+--------+--------+--------+
Notice that Ryan's score decreases but then increases later. The response that I previously received still selects Ryan in this case despite his scores not always increasing. I understand I might not have been clear in my original post, but is there any query I could do to fix this?
Thanks
EDIT: Sorry, I posted this very quickly.
Essentially I need a query to select the names of all of the people who got lower scores every consecutive test they attempted.
ie, not accept Ryan, but accept James
partitionbecause some findsqlto mean Sql Server