CREATE TABLE Member (Name VARCHAR(50), Age INT, City VARCHAR(100)); INSERT INTO Member (Name,Age,City) VALUES ('坂本',19,'東京'); INSERT INTO Member (Name,Age,City) VALUES ('中原',50,'大阪'); INSERT INTO Member (Name,Age,City) VALUES ('山岡',6,'東京'); INSERT INTO Member (Name,Age,City) VALUES ('赤橋',42,'北海道'); INSERT INTO Member (Name,Age,City) VALUES ('西',69,'大阪');
![SQLでグループごとにある最大値の行を取得する - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/c16a1b9a7c6b94b8701842603c08f041b3b8ad13/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-9f5428127621718a910c8b63951390ad.png%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTkxNiZoPTMzNiZ0eHQ9U1FMJUUzJTgxJUE3JUUzJTgyJUIwJUUzJTgzJUFCJUUzJTgzJUJDJUUzJTgzJTk3JUUzJTgxJTk0JUUzJTgxJUE4JUUzJTgxJUFCJUUzJTgxJTgyJUUzJTgyJThCJUU2JTlDJTgwJUU1JUE0JUE3JUU1JTgwJUE0JUUzJTgxJUFFJUU4JUExJThDJUUzJTgyJTkyJUU1JThGJTk2JUU1JUJFJTk3JUUzJTgxJTk5JUUzJTgyJThCJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9NTYmdHh0LWNsaXA9ZWxsaXBzaXMmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz01ZjYwMTc3ZGMwYjNlNmI1NjMzYjg2NTUwMDU3ODU5NQ%26mark-x%3D142%26mark-y%3D112%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTYxNiZ0eHQ9JTQwbm9naXRzdW5lNDEzJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9MzYmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz1lODVhMjg3MDIwZWI0ZDAyYmE0Y2ZkYzIxNDgxZDMyMg%26blend-x%3D142%26blend-y%3D491%26blend-mode%3Dnormal%26s%3D21beadb74da64cceafa57a2156cff72f)