MySQLã® order by 㨠index ã®ä»çµã¿ãããããªããªã£ãã®ã§èª¿æ»ã åæã®èªåã®ä»®å® MySQLã¯éé ã¤ã³ããã¯ã¹ããµãã¼ãããªãã®ã§ order by desc ã«ã¤ã³ããã¯ã¹ã使ç¨ã§ããªã (user_id, point)ã¨ããè¤åã¤ã³ããã¯ã¹ãããã°ãwhere user_id = ? order by point ascã¨ããã¯ã¨ãªã¯ã¤ã³ããã¯ã¹ãæ大éã«ä½¿ç¨ã§ãã æºå MySQLã®ãã¼ã¸ã§ã³ã¯ 5.1.61 CREATE TABLE `sample` ( `id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, `point` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `i1` (`user_id`,`point`) )
{{#tags}}- {{label}}
{{/tags}}