温故而知新呀!union出来的数据结果比单独一条一条执行查询的数据少,如下所示:

select date,note,carton,1 as js,business from  table1
union all select date,note,'none' as carton,js,business from table2
union all select shippingdate,deliverynum,caseno,qty,business from table3

这是为什么,因为union有自动去重功能,如果不想自动去重,请使用union all

10-17 13:18