方法一:
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
本文介绍了三种不同的方法来实现多张表的联合查询,包括创建视图和直接联接查询的方式,并展示了如何筛选特定时间段内的数据及按创建时间排序。
1745

被折叠的 条评论
为什么被折叠?



