i have one problem while making a query
wellid dated drillid
1 2000-05-01 11:30:00 123
1 2000-05-01 11:30:00 124
1 2000-05-01 11:35:00 123
1 2000-05-01 11:36:00 124
now i want to make a query that return one row when drillid is equal to 123, but there are two dated for drillid 123, so i want only those dated row whose datetime is maximum as compared to other whose drillid is 123 or 124.
suppose i run query for drillid 123 then it must return me
wellid dated drillid
1 2000-05-01 11:35:00 123
but not return me
wellid dated drillid
1 2000-05-01 11:30:00 123
1 Answer