end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

2012-03-29から1日間の記事一覧

mysqlのcase when によるクロス集計

http://torhamzedd.blogspot.jp/2010/06/mysql.html ↑こちらに書かれている通り、↓こう。 select name, count(case when color='白' then 1 else null end) as '白', count(case when color='赤' then 1 else null end) as '赤', count(case when color='青'…