MySQLã®Tips MySQLã§ãæååãçµåããã¨ãã«ã¯CONCAT()é¢æ°ã使ããããå¼æ°ã«ã²ã¨ã¤ã§ãNULLãåå¨ããã¨è¿ãå¤ãNULLã«ãªã£ã¦ãã¾ãã ããã§ãNULLããããããã£ã¼ã«ããçµåããã¨ãã«ã¯ããã®ãã£ã¼ã«ããIFNULL()é¢æ°ã§å²ã£ã¦ããã¨ããã CONCAT()ã«ã¤ãã¦ã¯ãMySQL :: MySQL 4.1 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã« :: 6.3.2 æååé¢æ°ããåç § IFNULL()ã«ã¤ãã¦ã¯ãMySQL :: MySQL 4.1 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã« :: 6.3.1.4 ããã¼å¶å¾¡é¢æ°ããåç § ä¾ SELECT CONCAT(IFNULL(name_l, "åç¡ãã®"), IFNULL(name_f, "æ¨©å µè¡ãã")) as name from users ã¡ãªã¿ã«æ°å¤è¨ç®ã§ãè¨ç®å¼ã«NULLãå«ãã¨NULLã«ãªã£ã¦ãã¾ãããåæ§ã«IFNULL()
{{#tags}}- {{label}}
{{/tags}}