In mysql, use
SELECT id, GROUP_CONCAT(data)
FROM yourtable
GROUP BY id
or use your custom separator:
SELECT id, GROUP_CONCAT(data SEPARATOR ', ')
FROM yourtable
GROUP BY id
see GROUP_CONCAT.
More Related Contents:
- Select first row in each GROUP BY group?
- Reason for Column is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause [duplicate]
- Using group by on multiple columns
- How to concatenate strings of a string field in a PostgreSQL ‘group by’ query?
- GROUP BY with MAX(DATE) [duplicate]
- SQL – using alias in Group By
- Is there any difference between GROUP BY and DISTINCT
- Group by minimum value in one field while selecting distinct rows
- must appear in the GROUP BY clause or be used in an aggregate function
- Cannot insert explicit value for identity column in table ‘table’ when IDENTITY_INSERT is set to OFF
- How to group time by hour or by 10 minutes
- Concat groups in SQL Server [duplicate]
- JOIN two SELECT statement results
- SQL query for finding records where count > 1
- GROUP BY + CASE statement
- SQL Group by & Max
- SQL to Entity Framework Count Group-By
- SQL GROUP BY CASE statement with aggregate function
- Mysql: how to select groups having certain values?
- MySQL #1140 – Mixing of GROUP columns
- SQL Server Update Group by
- Selecting all corresponding fields using MAX and GROUP BY
- How can I group time by hour or by 10 minutes?
- Huge performance difference when using GROUP BY vs DISTINCT
- SQL not a single-group group function
- What is the mysterious ‘timestamp’ datatype in Sybase?
- Conditional SQL count
- SQL query to group by day
- Why doesn’t Oracle SQL allow us to use column aliases in GROUP BY clauses?
- How to group by a Calculated Field