count number of rows returned

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yuva17raj
    New Member
    • Dec 2007
    • 19

    count number of rows returned

    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
    New Member
    • Jul 2008
    • 9

    #2
    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 `` "

    Comment

    • yuva17raj
      New Member
      • Dec 2007
      • 19

      #3
      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

      Comment

      Working...