SELECT a.nid,
GROUP_CONCAT(b.name ORDER BY b.id) DepartmentName
FROM Notes a
INNER JOIN Positions b
ON FIND_IN_SET(b.id, a.forDepts) > 0
GROUP BY a.nid
More Related Contents:
- MySQL Join two tables with comma separated values
- Laravel – only a zero is saved to the database
- storing user_id in session variable
- I am seeing this error on submitting form Error: query was empty [closed]
- Convert from MySQL datetime to another format with PHP
- MySQL vs MySQLi when using PHP [closed]
- How do I set ORDER BY params using prepared PDO statement?
- Passing an array to a query using a WHERE clause
- How can I store and retrieve images from a MySQL database using PHP?
- PHP/MySQL Insert null values
- mysqli_stmt::bind_param(): Number of elements in type definition string doesn’t match number of bind variables
- Laravel: PDOException: could not find driver
- Can you add an if statement in ORDER BY?
- PDO Connection Test
- Grouping WHERE clauses in Codeigniter
- MySQL (or PHP?) group results by field data
- SELECT COUNT() vs mysql_num_rows();
- Store procedures in phpMyAdmin
- Check if a row exists using old mysql_* API
- Unique IPs in a voting system
- MySQL get a random value between two values
- mysql – INSERT date range into date columns IF dates don’t overlap with existing ones
- php password_verify() hash and pass won’t match
- MySQL query using an array [duplicate]
- PHP mySQL – Insert new record into table with auto-increment on primary key
- Using Prepared Statement, how I return the id of the inserted row?
- How does {} affect a MySQL Query in PHP? [duplicate]
- When should I close a database connection in PHP?
- php connection pooling mysql [duplicate]
- Limit pagination page number