[EMAIL PROTECTED] wrote:
Hi,
I have a table with records dated 01-01-2007 00:00:00 to 01-02-2007
23:59:59. What I want to do is grab 1 random record in every 10 minutes
between the date. Please help me.
Regards,
Willy
Does it really need to be random? This works from me:
mysql> select `date` from table where mod(unix_timestamp(`date`), 600) =
0 limit 10;
+---------------------+
| date |
+---------------------+
| 2007-01-01 00:00:00 |
| 2007-01-01 00:10:00 |
| 2007-01-01 00:20:00 |
| 2007-01-01 00:30:00 |
| 2007-01-01 00:40:00 |
| 2007-01-01 00:50:00 |
| 2007-01-01 01:00:00 |
| 2007-01-01 01:10:00 |
| 2007-01-01 01:20:00 |
| 2007-01-01 01:30:00 |
+---------------------+
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]