Attacking rooks Time Limit: 20000ms, Special Time Limit:50000ms, Memory Limit:65536KB Total submit users: 12, Accepted users: 7 Problem 13028 : No special judgement Problem description Chess inspired problems are a common source of exercises in algor…
行转列 使用CASE语句: SELECT SUM(CASE USER_NAME='A' THEN KILLS END) AS 'A', SUM(CASE USERNAME='B' THEN KILL END) AS 'B', SUM(CASE USERNAME='C' THEN KILL END) AS 'C' FROM A INNER JOIN B ON A.NAME=B.USERNAME; 通过CASE给满足WHEN语句的数据返回SUM聚合函数要统计的数据,再将SUM进行重命名.推荐. 一般…