Results 1 to 2 of 2

Thread: Need Help!!

  1. #1
    Join Date
    Mar 2003
    Posts
    3

    Need Help!!

    Hi,

    I want to write a sql query for an asp page which will display only unique rows from the specified column along with the number of count for each unique row.

    Example:

    Table that I want to query

    Last Name || First Name
    Gates || Bill
    Boyce || Mike
    Gates || Bill
    Gates || Phil


    Results I want:

    Last Name || First Name || Count
    Gates || Bill || 2
    Boyce || Mike || 1
    Gates || Phil || 1

    Thanks a lot,
    Heta

  2. #2
    Join Date
    Feb 2003
    Posts
    14
    Select lastname, firstname, count(*)
    from <tablename>
    group by lastname, firstname

Posting Permissions

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