作者ClubT (We will Wii)
看板Database
标题[SQL ] 这样该如何做select
时间Tue Jul 29 17:54:23 2008
我现在想将2个select语法合成一个
select 日期,sum(F1) as Total from MyTable where Type='a' group by 日期
select 日期,sum(F1) as Total from MyTable where Type='b' group by 日期
假设2个select的结果是
日期 Total
==================== Type=a
2008/1/1 1000
2008/1/3 2000
==================== Type=b
2008/1/2 1500
2008/1/3 3000
希望的结果
日期 Totala Totalb
2008/1/1 1000
2008/1/2 1500
2008/1/3 2000 3000
请问可以做到这样吗?
THANKS^^
--
《我的Blog》
http://clubtblog.blogspot.com/
你的资料如下
《ID昵称》 ()
《上站次数》次
《文章篇数》篇
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.136.36.136
※ 编辑: ClubT 来自: 220.136.36.136 (07/29 17:54)