ã¾ããROW_NUMBERã使ãå ´åã«ã¯ãç¹ã«æ©ãå¿ è¦ã¯ããã¾ãããORDER BYã®ãã¼ã«è¿½å ãã¾ãããï¼ãªã¹ã3â ï¼â ãå®è¡çµæã¯å³2ã§ãã ãªã¹ã3ã主ãã¼ãè¤æ°åã®å ´å(ROW_NUMBER) SELECT class, student_id, ROW_NUMBER() OVER (ORDER BY class, student_id) AS seq FROM Weights2; å³2ããªã¹ã3ã4ã®å®è¡çµæ class student_id seq ----- ------------ --- 1 100 1 1 101 2 1 102 3 2 100 4 2 101 5 2 102 6 2 103 7 ä¸æ¹ãç¸é¢ãµãã¯ã¨ãªã®å ´åã¯ã©ãã§ããããããã¤ãæ¹æ³ãããã®ã§ãããç§ãæãã·ã³ãã«ã¨æãã®ã¯ãè¤åãã¼ãæååã¨ã¿ãªãã¦é£çµããå¼·å¼ã«1åã®ãã¼ã«ä½ãå¤ãã¦ãã¾ããã¨ã§ããã
{{#tags}}- {{label}}
{{/tags}}