select id,next_check_time,request_status From temp_order_job WHERE request_status = 1 AND next_check_time<1664360160 and id=271535;
这样查一下看看呢?
这tidb里不会有两个数据库都有这个表吧?我看上面两条SQL没指定表的数据库名…
select count() from (select id,next_check_time,request_status From temp_order_job WHERE request_status = 1 AND next_check_time<1664360160 order by id limit 50);
select count() from (select id,next_check_time,request_status From temp_order_job WHERE request_status = 1 AND next_check_time<1664360160);
select count(*) from (select id,next_check_time,request_status From temp_order_job WHERE request_status = 1 AND next_check_time<1664360160 order by id );
看看查询结果,哪个有问题?
select * from (select id,next_check_time,request_status From temp_order_job WHERE request_status = 1 AND next_check_time<1664360160 order by id ) t where t.id=271535;
这个有结果吗?
要是没有结果,看着就是limit和order by一起使用的问题…
select * from (select * from (select id,next_check_time,request_status From temp_order_job WHERE request_status = 1 AND next_check_time<1664360160 order by id ) t limit 50) tt where tt.id=271535;
–可以再考虑下,下面的SQL需要执行看看不?limit调整到查询出所有数据。。。
select * from (select * from (select id,next_check_time,request_status From temp_order_job WHERE request_status = 1 AND next_check_time<1664360160 order by id ) t limit 37000) tt where tt.id=271535;