自学内容网 自学内容网

asp.net老项目运维,出现的问题3

温故而知新呀!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


原文地址:https://blog.csdn.net/hmy123cq3/article/details/142825502

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!