Question

Hi I have below mysql table
mysql> select * from test_raw limit 5;

dt admin balance

2013-08-02 AR 8734736
2013-08-02 AZ 190
2013-08-02 BA 7007
2013-08-02 BE 7125
2013-08-02 BG 5189

I want to print data of a week considering that week starts from Thursday to Wednesday and I want to run query on Monday. Please suggest a way to print this data, is there a way to give date range between now( ) -11 to -4 day ?

Était-ce utile?

La solution

select * from sccp_raw 
where dt between curdate() - interval 11 day 
         and curdate() - interval 4 day
limit 5;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top