看板 Database 關於我們 聯絡資訊
我不知道ACCESS可不可以 我是用MS-SQL Select Time,Case when No=1 then sum(Value) else 0 end as '1', Case when No=2 then sum(Value) else 0 end as '2', Case when No=3 then sum(Value) else 0 end as '3' from TABLE_NAME group by Time 這是如果你的No確定只有1、2、3的時候可以這麼做 ※ 引述《tarjan (Mr. Everything)》之銘言: : 各位先進: : 我的table欄位如下: : Table Name: TB01 : Time No Value : t1 1 1.1 : t1 2 1.5 : t1 3 1.8 : t2 1 0.9 : t2 2 2.5 : 請問SQL語法能夠查出以下結果嗎? : Time 1 2 3 : t1 1.1 1.5 1.8 : t2 0.9 2.5 null : 又或者有啥方式能達到這個需求呢? -- 我的P2個板 自然就是美 傾聽‧自然之美 NB_COLSPRING 科技 Σ 冷 泉 港 >生命孕育地,海洋之心 ClubT [風] 有空可以來逛逛^_^ Blog: http://www.wretch.cc/blog/ClubT http://clubtblog.blogspot.com -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.219.179.43