按月分表数据分页查询

方法一:

create view CAB_OP_VIEW AS
select * from t_cab_op_202209
union all
select * from t_cab_op_202210
union all
select * from t_cab_op_202211;


select * from CAB_OP_VIEW where create_time between '2022-11-01'  and '2022-11-19' limit 10;

方法二:

select * from (
    select * from t_cab_op_202209 union
    select * from t_cab_op_202210 union
    select * from t_cab_op_202211
) t
where t.cab_code='221134310006' and t.create_time between '2022-09-01'  and '2022-11-19' order by t.create_time asc limit 10;


方法三:使用mycat

你可能感兴趣的:(mysql)