I have 3 tables that look like this -
- content
- cid
- data
- contenttags
- cid
- tid
- tags
- tid
- tag
I'm trying to select 5 items from the content table whilst display every tag associated with the content. Here's what I have -
SELECT c.*, t.tag FROM content AS c LEFT JOIN contenttags AS ct ON c.cid = ct.cid LEFT JOIN tags AS t ON ct.tid = t.tid LIMIT 5
But all I seem to get is a whole lot of duplicate rows with the only difference being the tag. I thought ideally, all the tags could be merged in sql into one field? I dunno, am I going about this all wrong?