Jump to content

[SOLVED] Count with a where clause


nathanblogs

Recommended Posts

hey,

 

I am trying to make a SQL statement that will allow me to select only group members that appear multiple times in a table. This is my current sql statement:

 

SELECT *, count(grpmem_peopleid) AS num FROM group_members
WHERE num > 1
GROUP BY grpmem_peopleid
ORDER BY num DESC 

 

my current error is this:

 

Unknown column 'num' in 'where clause'

Link to comment
https://forums.phpfreaks.com/topic/78883-solved-count-with-a-where-clause/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.