DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: COUNT

  1. #1
    Join Date
    Aug 2001
    Posts
    1
    I WANT TO COUNT DISTINCT COL1,COL2 FROM TABLE1
    SELECT COUNT(*) DISTINCT COL1, COL2 FROM TALBE1

  2. #2
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    1,185
    Try

    select count(distinct col1) from table1;

    select count(distinct col2) from table1;

    Good luck.
    David Knight
    OCP DBA 8i, 9i, 10g

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    If you want to count the distinct COMBINATIONS of COL!, COL2, use the following:


    SELECT COUNT(*) FROM
    (SELECT DISTINCT COL1, COL2 FROM TALBE1);
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

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