博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mysql 多表合并统计
阅读量:6992 次
发布时间:2019-06-27

本文共 440 字,大约阅读时间需要 1 分钟。

hot3.png

select count(*) ,t.warehouse , DATE_FORMAT(t.shipped_date, '%Y-%m-%d') shipped_date  from  (		select order_no,warehouse,shipped_date,rowstate from customer_order_tab 	union all 	select order_no,warehouse,shipped_date,rowstate from customer_order_arc_tab ) twhere t.rowstate in ('Delivered','Returned') group by  t.warehouse,DATE_FORMAT(t.shipped_date, '%Y-%m-%d')order by t.shipped_date asc

 

转载于:https://my.oschina.net/u/3556610/blog/1816528

你可能感兴趣的文章
CSAPP 六个重要的实验 lab5
查看>>
迭代中删除元素
查看>>
php中pdo例子
查看>>
ZOOKEEPER在CENTOS6上的再安装
查看>>
simplified build configuration
查看>>
Turn the corner (三分)
查看>>
java Webservice(一)HttpClient使用(一)
查看>>
cookie (储存在用户本地终端上的数据)
查看>>
你真的会玩SQL吗?之逻辑查询处理阶段
查看>>
用字体制作小图标
查看>>
python之函数用法startswith()
查看>>
while(scanf("%d",&n)!=EOF)与while(cin>>n)
查看>>
BigTale
查看>>
UITabBarController 笔记(一)AppDelegate中加UITabBarController 为 rootViewController
查看>>
oracle基础备份和还原
查看>>
Velocity 语法示例
查看>>
golang的ssh例子
查看>>
【python】pymongo中正则查询时的转义问题
查看>>
立足“快时尚”,联想笋尖S90怎样诠释“比美更美”?
查看>>
linux下执行strlwr函数出错:ld returned 1 exit status
查看>>