Forums

This topic is locked

select count

Posted 06 Aug 2002 01:49:35
1
has voted
06 Aug 2002 01:49:35 chris espino posted:
I'm able to figure this out, but blacked out when it's time to add the count expression.

SELECT Distinct Users
FROM Posts
ORDER BY Users ASC

now, I'd like to add a count on every posts the user has beside their name.

kind of like:

Ben 15 Posts
Chris 2 Posts
Jack 9 Posts etc.

SELECT Distinct Users
(SELECT Count(Users)
Where ... ok this is where I get stuck!)
As Total_Posts
FROM Posts
ORDER BY Users ASC


thanks in advance!

Replies

Replied 20 Aug 2002 16:13:14
20 Aug 2002 16:13:14 Dave Thomas replied:
Try something like

SELECT users, count(total_posts)
FROM posts
WHERE total_posts > 0
ORDER BY total_posts DESC;

Regards,
Dave

UD4 || Flash || Access ||Web Hosting


Edited by - UltraDav on 20 Aug 2002 16:20:14

Reply to this topic