Can I get random items on the same day?
For instance:
+ ---- + --------------------- +
| id | md |
+ ---- + --------------------- +
| 1 | 2010-06-27 11:26:01 |
| 2 | 2010-06-27 11:28:20 |
| 3 | 2010-06-27 11:29:46 |
| 4 | 2010-06-27 11:30:50 |
| 5 | 2010-06-27 12:20:56 |
| 6 | 2010-06-27 12:27:42 |
| 7 | 2010-06-27 15:14:05 |
| 8 | 2010-07-06 01:53:33 |
| 9 | 2010-07-06 01:52:52 |
+ ---- + --------------------- +
I want to select random items on the same day, but at the same time I want it to be sorted by date in descending order. Something like that:
+ ---- + --------------------- +
| id | md |
+ ---- + --------------------- +
| 8 | 2010-07-06 01:53:33 | random block
| 9 | 2010-07-06 01:52:52 |
| 2 | 2010-06-27 11:28:20 | random block
| 4 | 2010-06-27 11:30:50 |
| 1 | 2010-06-27 11:26:01 |
| 6 | 2010-06-27 12:27:42 |
| 3 | 2010-06-27 11:29:46 |
| 5 | 2010-06-27 12:20:56 |
| 7 | 2010-06-27 15:14:05 |
+ ---- + --------------------- +
I donβt know how to start, or if itβs possible, since order by rand () will not accept grouping.