2 回答

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超8個(gè)贊
select oilstandard,
sum(case PIN when '93#' then RetailLiterprice else 0 end) as '93#',
sum(case PIN when '97#' then RetailLiterprice else 0 end) as '97#',
sum(case PIN when '0#' then RetailLiterprice else 0 end) as '0#'
from cnblogs
group by OilStandard
不知道是不是樓主想要的結(jié)果

TA貢獻(xiàn)1803條經(jīng)驗(yàn) 獲得超3個(gè)贊
select RetailiterPrice1=(select RetailiterPrice from ”table“ where PIN=”93#“),RetailiterPrice2=(select RetailiterPrice from ”table“ where PIN=”97#“),RetailiterPrice3=(select RetailiterPrice from ”table“ where PIN=”0#“) from "table" where oilstandard="國(guó)III"
大概是這個(gè)意思吧,你可以試下。
- 2 回答
- 0 關(guān)注
- 838 瀏覽
添加回答
舉報(bào)