You’re looking for GROUP_CONCAT()
Try this:
select group_concat(MyString separator ', ') as myList from table
where id < 4
Of course, you can group by
the results.
More Related Contents:
- SQL select only rows with max value on a column [duplicate]
- SELECTING with multiple WHERE conditions on same column
- MySQL “Group By” and “Order By”
- Is there ANY_VALUE capability for mysql 5.6?
- SQL Query to get column values that correspond with MAX value of another column?
- How to fetch the first and last record of a grouped record in a MySQL query with aggregate functions?
- use mysql SUM() in a WHERE clause
- MySQL dynamic cross tab
- How to select data where a field has a min value in MySQL?
- mysql count group by having
- Find duplicate records in MySQL
- MySQL order by before group by
- MySQL Cannot Add Foreign Key Constraint
- Which is fastest? SELECT SQL_CALC_FOUND_ROWS FROM `table`, or SELECT COUNT(*)
- Difference between float and decimal data type
- Convert timestamp to date in MySQL query
- Update a column value, replacing part of a string
- Parse date in MySQL
- View’s SELECT contains a subquery in the FROM clause
- Sort by order of values in a select statement “in” clause in mysql
- How to re-sync the Mysql DB if Master and slave have different database incase of Mysql replication?
- ORDER BY date and time BEFORE GROUP BY name in mysql
- MySQL INT meaning
- MySQL Stored Procedures not working with SELECT (basic question)
- MySQL LAST_INSERT_ID() used with multiple records INSERT statement
- MySQL vs. JSON – Why? [closed]
- Should I always prefer MySQL InnoDB over MyISAM?
- MySQL add 12 hours to a time field
- OSX ld: library not found for -lssl
- MySQL: Find Missing Dates Between a Date Range