2 tables:
name
id | title
and
content
name | title
One name has several contents. name.id ~ content.name
I need to get 3 names with all theirs content.
SELECT name.title, content.title
FROM name LEFT JOIN content ON name.id = content.name
LIMIT 3
result in 3 contents, not names
Is it possible to do this with one query?
Try this:
Also, you need to use an
aliasbecause you are selecting twotitlefields:Update:
I think you need only the
namefield as far as i could figure out from your comment, try this: