How to SELECT by MAX(date)?

前端 未结 12 1600
独厮守ぢ
独厮守ぢ 2020-12-03 02:49

This is the table structure:

CREATE TABLE `reports` (
  `report_id` int(11) NOT NULL auto_increment,
  `computer_id` int(11) NOT NULL default \'0\',
  `date_e         


        
12条回答
  •  囚心锁ツ
    2020-12-03 03:22

    Did this on a blog engine to get the latest blog. I adapted it to your table structure.

    SELECT * FROM reports WHERE date_entered = (SELECT max(date_entered) FROM REPORTS)
    

提交回复
热议问题