SQL ãã§è¡ã横å±é - miau's blog? ãã®ã¢ã¤ãã ãblog ã®ä¸ã§ãåç §çãé«ããã¤ãªãã§ããã ã»åå¾ããåã®æ°ãéå®ããã¦ããã®ã§ãæ¬å½ã®é¢é£ãã¼ãã«ã£ã½ãã®ã«ã¯ä½¿ãã«ãã ã»sub_id ã¿ãããªã®ãæããªããã¼ãã«ã«ã¯ä½¿ããªã ã»ãªãã ããã ã§ãæ¸ãã®ãé¢å ã¨ããæ¬ ç¹ãããã¾ãã ãã åã«è¦ããã表示ãããã ãã§ããã°ãPostgreSQL ã§ãã£ã¨æ¥½ã«ã§ããæ¹æ³ãããã¾ãããã£ã¦è©±ãï¼å¤å°é£ããï¼ PostgreSQL ã§ã¯ãéç´é¢æ°ãèªåã§å®ç¾©ã§ããããã¾ãã ãããä½ã£ã¦ãã¾ãã¨ã SELECT id, SUM(point) FROM Points GROUP BY id ã¿ãããªããªã§ãã«ã³ãã§æååãçµåãããéç´å¦ç SELECT id, comma_join(point_name) FROM Points GROUP BY id ã¿ãããªãã¨ãã§ã
{{#tags}}- {{label}}
{{/tags}}