Hello,
i'm trying to write a query that seems rather simple...
So, considering the 3 important fields in my query :
table1(id_table1,id_table2,event).
This table is linked to another table with a 1-n linkage.
So, different entries in the table1 can have the same id_table2, but different id_table1 and event.
There's an order for those events (their value can be from 1 to 5).
I mean, if there is a row in the table with the value 3 in the event field, there must be at least 2 other rows sharing the same id_table2 with the value 1 and 2 in the event field.
I want to get for example the rows of which event value is 2, and for which there are no result sharing the same id_table2 with higher event value. (really difficult to explain this problem I don't know if it's clear).
but for example :
(id_table1,id_table2,event)
(50,50,1)
(51,50,2)
(52,60,1)
(53,60,2)
(54,60,3)
---> I want to get only the 2nd row : (51,50,2)
I'm really unable to write this query !
Thanks