下面这样的情况是不是可以用一句query 出来?
从一个表 :
orderid,storeid,itemid,quantity,date
导出另外一个表:
colum1: 下面是itemname1,itemname2,itemname3......
colum2: TH->storeid1 ,然后下面是 quantity1(对应itemname1),quantity2(对应itemname2),quantiy3(对应itemname3).......
colum3: TH->storeid2, 然后下面是 quantity1(对应itemname1),quantity2(对应itemname2),quantity3(对应itemname3)........
.
.
.
columend:TH->total, 然后下面是 total1(for quantity1),total2(for quantity2),...
请问这个怎样实现 ?thanks!
请问 SQL 高手
所有跟帖:
•
你是要一个报表,最后一行是前面各行的求和,是吗?
-布衣之才-
♂
(36 bytes)
()
06/16/2009 postreply
17:44:38
•
回复:请问 SQL 高手
-XDJM1234-
♂
(122 bytes)
()
06/16/2009 postreply
17:50:51
•
回复:回复:请问 SQL 高手
-布衣之才-
♂
(152 bytes)
()
06/16/2009 postreply
18:10:20
•
if oracle, #2: just use rollup() groupiing
-lambada-
♀
(0 bytes)
()
06/16/2009 postreply
17:59:06
•
回复:if oracle, #2: just use rollup() groupiing
-布衣之才-
♂
(29 bytes)
()
06/16/2009 postreply
18:13:00
•
你的这些表首先要 Normalize 几下子哈。。。
-多哥-
♀
(0 bytes)
()
06/16/2009 postreply
18:49:14
•
他好像就一个表吧,后面说的都是取出来的columns and rows
-布衣之才-
♂
(0 bytes)
()
06/16/2009 postreply
18:51:02
•
fact table(s), dimension(s)...
-HappyNow?!-
♂
(51 bytes)
()
06/16/2009 postreply
18:58:40
•
请问:SQL的就业机会多吗?都在什么领域?
-coolwin-
♀
(57 bytes)
()
06/16/2009 postreply
23:38:29
•
回复:请问 SQL 高手
-tapisapi2008-
♂
(142 bytes)
()
06/18/2009 postreply
18:12:32
•
How many stores are there?
-万见愁-
♂
(744 bytes)
()
06/21/2009 postreply
00:30:31