MySQLã§ããµãã¯ã¨ãªã¼ã使ãããã¨ãæãåºãã¦ãã¨ããããã¸ã§ã¯ãã§ä½¿ã£ã¦ã¿ããã¨ã«ãããããã£ã¨ã以ä¸ã®ãããªSQLãæ¸ãã¨ï½¥ï½¥ï½¥ INSERT INTO exam ( type, code ) VALUES ( 'A', ( SELECT IFNULL( MAX( code ) + 1, 1000 ) FROM exam WHERE type='A' ) ); #1093 - You can't specify target table 'exam' for update in FROM clause ã¨æããã¦ãã¾ã£ãã æ£ç´ãªè©±ãSQLã¯å¾æã¨ããããã§ã¯ãªãã®ã§ã æåã¯ãã£ã±ãç¡çï¼ã¨æã£ã¦ãã¾ã£ãã ããæ°ãåãç´ãã¦ãmysql 1093ãã§ã°ã°ã£ã¦ã¿ãã¨ãçãã®ãã¼ã¸ãçºè¦ãMySQLã ããã§ã¯ãªããSQLæ¨æºããè¦ã¦ãééã£ãæ§æãªãã ããã ã ç°¡åã«åé¡ã®èª¬æãã
{{#tags}}- {{label}}
{{/tags}}