alfieshooter Posted February 27, 2009 Share Posted February 27, 2009 Hi Am having problems with a query which I know should be really simple. I have a database called Fanfeed: username, fanof, type I want to be able to count how many unique entries each member has: Rita, Sue, R Rita, Sue, R Bob, Rita, R Sue, Bob, R Sue, Rita, R Bob, Sue, R Rita, Sue, R Sue, Bob, R Would output: Sue 2 Rita 2 Bob 1 (Even though Sue has 4 entries, she only has 2 unique entries from Bob and Rita etc.) I’m sure it should be easy...PLEASE HELP! Alfie. Link to comment https://forums.phpfreaks.com/topic/147157-count-group-by-oh-i-dont-know-im-hopless/ Share on other sites More sharing options...
fenway Posted February 28, 2009 Share Posted February 28, 2009 count(distinct fanof) from yourtable group by username Link to comment https://forums.phpfreaks.com/topic/147157-count-group-by-oh-i-dont-know-im-hopless/#findComment-773302 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.