|
|
GROUP_CONCAT function in Mysql - Mysql
|
Views : 195
|
|
Tagged in : Mysql
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
GROUP_CONCAT function in Mysql
GROUP_CONCAT() function is used to concatenate column values into a single string. Note that this function will not count null values. This is very useful group by function if you need records from database with multiple rows in single string with specified seperator(e.g. Comma seperated).
Example:
Table tbl_users have 4 records in column "name".
- Hariharan
- Harish
- Haripranav
- Prabhu
SELECT name FROM tbl_users;
OutPut:
- Hariharan
- Harish
- Haripranav
- Prabhu
SELECT GROUP_CONCAT(name) FROM tbl_users;
Output:
Hariharan,Harish,Haripranav,Prabhu |
|
By Rekha, On - 2010-10-01 |
|
|
|