表之间的数据匹配(Oracle)

来源表1:sql

来源表2:3d

生成一个交叉表:blog

sql:test

select t.course_name,
max(case when t.month='200706' then 'o' else '*' end) "6月",
max(case when t.month='200707' then 'o' else '*' end) "7月",
max(case when t.month='200708' then 'o' else '*' end) "8月"
from
(select month,course_name from dim_ia_test20 a,dim_ia_test21 b where a.course_id=b.course_id)t
group by course_name;select

相关文章
相关标签/搜索