日期:2014-05-18 浏览次数:20742 次
select age_level, (case when age_level = 1 then Chile_num when age_level=2 then adult_num when age_level=3 then older_num end)as num, (case when age_level = 1 then Chile_pay when age_level=2 then adult_pay when age_level=3 then older_pay end)as pay, (case when age_level = 1 then Chile_time when age_level=2 then adult_time when age_level=3 then older_time end)as time from table
------解决方案--------------------
decode(age_level,1,child_num ,2,adult_num, older_num)num , decode(age_level,1,child_pay ,2,adult_pay, older_pay)pay , decode(age_level,1,child_time,2,adult_time, older_time)time,