Mysql
 sql >> Database >  >> RDS >> Mysql

Come SELEZIONARE entro MAX(data)?

Questo dovrebbe farlo:

SELECT report_id, computer_id, date_entered
FROM reports AS a
WHERE date_entered = (
    SELECT MAX(date_entered)
    FROM reports AS b
    WHERE a.report_id = b.report_id
      AND a.computer_id = b.computer_id
)