ã¾ããCREATE FUNCTION æã§ã¦ã¼ã¶å®ç¾©ã®Windowé¢æ°ã追å ãããã¨ãã§ãã¾ããããã¼ã¸ã§ã³ 8.4 ã§ã¯Cè¨èªã§é¢æ°ãè¨è¿°ããå¿ è¦ãããã¾ããSQLãPL/pgSQLã¯ä½¿ããªãã®ã§ãæ·å± ã¯é«ãããããã¾ããã ä¾ å ¸åçãªWindowé¢æ°ã®ä½¿ãæ¹ãæãã¾ãããã®ä»ã«ããããã¾ã§è¤éãªSQLãå¿ è¦ã ã£ããã¾ãã¾ãªã±ã¼ã¹ãå¹çåã§ããå¯è½æ§ãããã¾ãã®ã§ãSQLããºã«ã ã¨æã£ã¦è©¦ãã¦ã¿ã¦ãã ãããã é£çªä»ä¸ é£çªä»ä¸ãè¡ãã¾ããã½ã¼ãããå¾ãçªå·ããµãã®ããã¤ã³ãã§ãã SELECT row_number() OVER (), * FROM (SELECT * FROM tbl ORDER BY sortkey) AS t; ãã ããçµæã®æ大è¡æ°ãæå®ããã«ã¯ãrow_number ã¨ã®å¤ã®æ¯è¼ã§ã¯ãªããããã¾ã§ã©ãã LIMIT å¥ã使ã£ã¦ãã ãããrow_number
{{#tags}}- {{label}}
{{/tags}}