下麵這樣的情況是不是可以用一句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