Help with an SQL Query
i have this table that have this for example:
NUM1 BOX Status DATA
134813 119874 1 07.03.21
149950 119874 8 10.12.31
What I want to do is to select from the table COMERT, where boxID = 119874, and have status 1, but if in the table have more than one row, compare the dates to see if the date from status 1 is more actual than the others. If it doesn't to not return a开发者_如何学编程nything. How could I do this?
select * from Comert
where boxID = 119874 and status=1
and date=(select max(date) from comert where boxID = 119874)
精彩评论