this is my table:
profile(id,name,fnum)
example in the fmnum field their are 3 rows with the same values.
now i just want to count how many 3 rows with the same values in that table..
can u help me on this...thank you..
Problem: Counting Rows
Moderator: General Moderators
Re: Problem: Counting Rows
I'm not sure exactly what you are asking for, but you have to look at the group by and having statements
SELECT COUNT(*) AS GroupCount FROM profile GROUP BY fnum HAVING GroupCount = 3
SELECT COUNT(*) AS GroupCount FROM profile GROUP BY fnum HAVING GroupCount = 3
-
chelflores
- Forum Newbie
- Posts: 8
- Joined: Tue Jun 24, 2008 7:00 pm
Re: Problem: Counting Rows
I just solve my problem a while ago. But thanks anyway
This is the query:
SELECT COUNT(*), fmnum FROM db_profile GROUP BY fmnum HAVING COUNT(*) = 3
This is the query:
SELECT COUNT(*), fmnum FROM db_profile GROUP BY fmnum HAVING COUNT(*) = 3