i have a table education containing a person id and an education level id, both foreign keys. i want to group the results so each person record is singular, containing a list of all education levels, so it returns Jane Doe: master, master
select
concat(person.name_first," ",person.name_last) as name,
group_concat(person_studylevel.description)
from `person_education`
left join person_studylevel on level = person_studylevel.id
left join person on junior = person.id
this worked until i added the group_concat(), it then returns an empty result set
ive tried using the result as a subquery but that didnt work as well
table structure:
person_education: id(int10), junior(int10), level(int10)
person_studylevel: id(int10), description(varchar100)
person: id(int10), name_first(varchar255), name_last(varchar255)
Check this out please, if you want to group by each person, then take that table as the first to the left:
SQLFIDDLE DEMO
Query: