Created
July 14, 2014 15:35
-
-
Save c0ldlimit/892a6d65eef08a92fb4e to your computer and use it in GitHub Desktop.
#sql select by max(date) - select the max entry date row
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--http://stackoverflow.com/questions/7836036/how-to-select-by-maxdate | |
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 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment