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不知道是不是楼主想要的结果
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="国III"大概是这个意思吧,你可以试下。