I need to send out an email in bulk, with the email containing each course associated with that particular user's email. The following query will return a list of all courses and users associated with them.
select (cm.course_id + ': '+ cm.course_name) as course,
u.lastname, u.firstname, u.email from course_users cu
join users u on u.pk1 = cu.users_pk1
join course_main cm on cm.pk1 = cu.crsmain_pk1
The trouble is that for the Mail Merge to work properly, I need each user listed only once, and all associated courses in a single (delimited) cell for that row.
Any help is appreciated!
EDIT: Removing text about the CONCAT() function because it's just distracting.