Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select places.*, group_concat(category_name) from places
- left join category_place
- on category_place.place_id = places.id
- left join category
- on category.id = category_place.category_id
- where category.name like '%something%'
- #Problem: I need to select all the places that match certain category criteria, but i need to return, along #with the results, all the categories that place has, but with the where clause, its just returning the #'%something%' category, not the other ones
- #What i need:
- #Ej: place_id | group_concat(category.name)
- # 1 something, foo, bar
- #What im getting:
- #Ej: place_id | group_concat(category.name)
- # 1 something
Add Comment
Please, Sign In to add comment