ã©ã³ãã³ã°ãåå¾ããSQL ã§ãã åãã¹ã³ã¢ã®å ´åã¯åãé ä½ã«ãããªã©ã®å¿ è¦ãããããçµæ§é¢åã§ããã ä¸è¨SQL ã§ã¤ãããã§åå¾ã§ãã¾ãã å®éã«æºå¸¯ã²ã¼ã ã®ã©ã³ãã³ã°ãåå¾ããã®ã«ä½¿ç¨ãã¦ããSQLã§ãã ranking ãã¼ãã« CREATE TABLE ranking ( id bigint(20) NOT NULL auto_increment, name varchar(20) NOT NULL, score bigint(20) NOT NULL, ); SQL SELECT r1.name, r1.score, (SELECT count(r2.score) FROM ranking as r2 WHERE r2.score>r1.score)+1 as rank FROM ranking as r1 ORDER BY r1.score DESC LIMIT 10; r
{{#tags}}- {{label}}
{{/tags}}