Results 1 to 32 of 32

Thread: Count The Number Of Records Returned From A SELECT Query

Threaded View

  1. #14

    Thread Starter
    Frenzied Member SeanK's Avatar
    Join Date
    May 2002
    Location
    Boston MA
    Posts
    1,160

    Re: Count The Number Of Records Returned From A SELECT Query

    Quote Originally Posted by szlamany
    [edit] hey - I passed 7000 posts!
    Congratulations!!!
    Quote Originally Posted by szlamany
    Select 1,Gender, Count(*) From Student_T Group by Gender

    Union All

    Select 2, 'Total', Count(*) From Student_T

    Order by 1,2
    This has possibilities. Let me give this a whirl around the block and see what happens.

    Edit: On second thought, don't I need the same number of somethings (I don't remember what now) in both SELECTS? If my first SELECT has a ton of fields and a GROUP BY and my second SELECT only has a COUNT and no GROUP BY isn't SQL Server going to throw up?
    Last edited by SeanK; Sep 8th, 2006 at 11:43 AM.
    Beantown Boy
    Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width