来源表1: 来源表2: 生成一个交叉表: sql: 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月"fr
<?php /* * * MySQL_5.5中文参考手册 485开始 * * mysql> SELECT CASE 1 WHEN 1 THEN 'one' -> WHEN 2 THEN 'two' ELSE 'more' END; -> 'one' mysql> SELECT CASE WHEN 1>0 THEN 'true' ELSE 'false' END; -> 'true' mysql> SELECT CASE BINARY 'B' -> WH