之前做货品横向展示时,有看到评论说用到交叉表. 公司最近需要给订单表做一个数据汇总的功能,同事给到一个参考SQL select * from (select COUNT(1) as 已锁定 from tbl_order where orderLock = 1) as A,(select COUNT(1) as 未锁定 from tbl_order where orderLock = 0) as B,(select COUNT(1) as 未发货 from tbl_order where Push…