hno Posted May 10, 2009 Share Posted May 10, 2009 HI What is the difference between these two queries : 1- select CONCAT(last_name , ',' , first_name)... 2-select CONCAT_WS(' ' ,first_name,last_name)... And what is the advantage of using them instead of this kind of query: "select first_name , last-name ....". Thanks Quote Link to comment https://forums.phpfreaks.com/topic/157598-question-about-queries/ Share on other sites More sharing options...
GingerRobot Posted May 10, 2009 Share Posted May 10, 2009 The manual page should answer that for you: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html It really should be your first port of call for questions such as these. Quote Link to comment https://forums.phpfreaks.com/topic/157598-question-about-queries/#findComment-831040 Share on other sites More sharing options...
fenway Posted May 11, 2009 Share Posted May 11, 2009 (2) is much less error-prone than (1). And to answer your 2nd question, it's simply easier to handle downstream Quote Link to comment https://forums.phpfreaks.com/topic/157598-question-about-queries/#findComment-831557 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.