If you're looking for the records from the last full day contained in
the data, not the past 24 hours according to the clock, then this
ought to work:

select * from table
where InsertDate >= date_sub( (select max(InsertDate from table),interval 1 day)
order by InserDate desc

Dan


On 11/14/06, Vittorio Zuccalà <[EMAIL PROTECTED]> wrote:
Hello,
i've a table with a lot of field and in particular: "InsertDate","Box","Prt"
Example:
InsertDate, Box, PRT
2006-11-01, BXT, 34
2006-11-01, TTS, 33
2006-11-01, RRT, 55
2006-11-02, BXT, 22
2006-11-02, TTS, 99
2006-11-02, SAR, 75


I'd like to find all record inserted in the last day...
In this example the last three records...
I do not know which is the last day before

Any suggestions?




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to