获取id为0,10,20,30等的mysql记录


Fetch mysql records where id is 0,10,20,30, etc

我在数据库中有大约30000条记录,我必须为这些记录创建10个cron作业:

作业1获取列"id"为0、10、20、30等的记录。作业2获取列"id"为1,11,21,31等的记录。

等等。

我该如何处理?

使用运算符

select * from your_table
where id % 10 = 1

以获得1,11,21,31,...等。以及

where id % 10 = 2

对于CCD_ 2。