Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

count number of rows returned

Question posted by: yuva17raj (Newbie) on July 4th, 2008 02:32 PM
hi
i am using the select query with group by, so that i am getting records with more than one column so that i need to calculate the number of rows returned by the query for example

with my select ..group by i get the result as follows
userid count(*)
101 12
105 13
100 10
34 6
but i need to calculate number of rows returned so that my result is 4 kindly specify me with example
regards
yuvaraj
Dekudude's Avatar
Dekudude
Newbie
9 Posts
July 4th, 2008
06:23 PM
#2

Re: count number of rows returned
Do you want to count the number of rows returned, or do you want to limit it to only 4, so no more show up? If the latter, add "LIMIT 4" after "GROUP BY `` "

Reply
yuva17raj's Avatar
yuva17raj
Newbie
18 Posts
July 7th, 2008
10:07 AM
#3

Re: count number of rows returned
hi
thanks for the reply and i have got the result by using this example query
select count(*) from(select distinct(userid),max(mark) from testtable groupby userid having mark > 90) as single
regards
yuvaraj

Reply
Reply
Not the answer you were looking for? Post your question . . .
189,878 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Python Forum Contributors