I have 2 tables,
TOPICS
topic_id
topic_description
POSTS
post_id
topic_id
post_description
what I want is a query to select all the items from TOPICS, but only one item from POSTS for each topic(the one with the lowest post_id).
Any idea how to do this query?
I can sorta do it, but I can't get my post_description field?
SELECT topics.topic_id, topics.topic_description, (select min (posts.post_id) from posts where topic_id=topics.topic_id)
FROM topics
thanks
TOPICS
topic_id
topic_description
POSTS
post_id
topic_id
post_description
what I want is a query to select all the items from TOPICS, but only one item from POSTS for each topic(the one with the lowest post_id).
Any idea how to do this query?
I can sorta do it, but I can't get my post_description field?
SELECT topics.topic_id, topics.topic_description, (select min (posts.post_id) from posts where topic_id=topics.topic_id)
FROM topics
thanks
