Juan Pablo González
MrExcel MVP
- Joined
- Feb 8, 2002
- Messages
- 11,959
Hey guys,
I'm trying to expand the functionality of the 'View unanswered posts' query, so it can show more unanswered posts than only those that have 0 replies.
My idea is this, look for all the topics that have > 0 replies, and in those, see if all the posters are the same (which would mean "bumps" by the OP).
I think I'm on the right track with this:
but what I need is to SELECT from this "intermediate" results, only those records in which t.topic_id appears ONCE.
Any ideas how to do that ?
So what I *think* I need is something like
But it's not working (or it would be up and running now !!!)
I'm trying to expand the functionality of the 'View unanswered posts' query, so it can show more unanswered posts than only those that have 0 replies.
My idea is this, look for all the topics that have > 0 replies, and in those, see if all the posters are the same (which would mean "bumps" by the OP).
I think I'm on the right track with this:
Code:
SELECT t.topic_id FROM topics t, posts p WHERE t.topic_id = p.topic_id AND t.topic_replies > 0 GROUP BY t.topic_id, p.poster_id
but what I need is to SELECT from this "intermediate" results, only those records in which t.topic_id appears ONCE.
Any ideas how to do that ?
So what I *think* I need is something like
Code:
SELECT * FROM (SELECT t.topic_id FROM topics t, posts p WHERE t.topic_id = p.topic_id AND t.topic_replies > 0 GROUP BY t.topic_id, p.poster_id) WHERE COUNT(topic_id) = 1
But it's not working (or it would be up and running now !!!)