Combining two tables
I'm not used to set join queries so i'd like to ask help for this case.
I have two tables with fields:
now i'd like to get 5 newist topics from all forums, where priviledge is 0!
SELECT topics.topic_id, topics.topic_title
WHERE forums.forum_id=topics.topic_forum_id AND forums.forum_priviledge=0
ORDER BY topics.topic_created
But i think i need to join this to get it work or how does it work?
Let me see if I have understood you correctly. Do you want to obtain the five newest topics in all forums (five from the first forum, five from the second forum etc.), or just the five newest topics (regardless of which forum they were posted in) ?
Just the five newest topics regardless of which forum they were posted in. Sorry for unexact problem description.
where forum_priviledge = 0
by topic_created desc