The flowing sql first execute order by reg_time and then execute limit but I want to first execute limit and after order by.who can tell me what to do.
select * from user where province = 'hai' order by reg_time limit 0,20;
Strange requirement, if you really really want that, you can try subquery:
select *
from (select * from user where province = 'hai' limit 0,20) t
order by reg_time