You can use GROUP_CONCAT to perform that, e.g. something like
SELECT p.id, p.name, GROUP_CONCAT(s.name) AS site_list
FROM sites s
INNER JOIN publications p ON(s.id = p.site_id)
GROUP BY p.id, p.name;
More Related Contents:
- How to use GROUP BY to concatenate strings in MySQL?
- You can’t specify target table for update in FROM clause
- Generating a range of numbers in MySQL
- generate days from date range
- How can I combine multiple rows into a comma-delimited list in Oracle? [duplicate]
- Concatenate row values T-SQL
- SQLite INSERT – ON DUPLICATE KEY UPDATE (UPSERT)
- MIN/MAX vs ORDER BY and LIMIT
- How can I merge two MySQL tables?
- Can table columns with a Foreign Key be NULL?
- Oracle SQL, concatenate multiple columns + add text
- Mysql recursion?
- is there a group_concat function in ms-access?
- Is there an alternative to TOP in MySQL?
- How many rows in a database are TOO MANY?
- Concatenate and group multiple rows in Oracle [duplicate]
- Why does this SQL code give error 1066 (Not unique table/alias: ‘user’)?
- Is it possible to have an indexed view in MySQL?
- mysql – how many columns is too many?
- Best database field type for a URL
- Use A Union Or A Join – What Is Faster [closed]
- MySQL – how to front pad zip code with “0”?
- Find the number of columns in a table
- Mysql, reshape data from long / tall to wide
- MySQL: Compare differences between two tables
- Mysql strip time component from datetime
- How do I start auto increment from a specific point?
- How important are lookup tables?
- In SQL how do I get the maximum value for an integer?
- Get the first and last date of next month in MySQL