Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このような表では:
MySQLクエリを使用して、各国の男性と女性の年ごとの合計を含む配列を直接取得する方法はありますか?
例えば:
cittadinanza 1987 1988 1990 ... Afghanistan 13 13 12 ... Albania 22 20 19 ... ... .. .. .. ...
はい、国ごとにグループ化する必要があります。
SELECT `citidinanza`, SUM(`1987`) as `1987`, SUM( `1988`) AS `1988` FROM `table` GROUP BY `citidinanza`