0

hi,

i have a table which have code col and data col.the code and data occur repeated no of time.
so i run query like

SELECT code, COUNT( code ) AS no_of_times
FROM testing_table
GROUP BY code
ORDER BY code

which give no of time code is repeated in the table but i also wants the data corresponding to code to be concated and shown in different col.

i need query for this

regards
rajan

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by smantscheff
0

You can use the group_concat() function:

SELECT code, COUNT( code ), group_concat(data) AS no_of_times
FROM testing_table
GROUP BY code
ORDER BY code
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.