distinct values in a partition
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: distinct values in a partition

  1. #1
    Join Date
    Jul 2006
    Posts
    195

    distinct values in a partition

    Does anybody know of a query I can use to find distinct values within a partition?

  2. #2
    Join Date
    Apr 2006
    Posts
    377
    Code:
    select distinct <column_name> 
    from <table_name> partition <partition_name>;

  3. #3
    Join Date
    Jul 2006
    Posts
    195
    Quote Originally Posted by ebrian View Post
    Code:
    select distinct  
    from  partition ;
    Am I missing something?

    SQL> desc month_part;
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    A NUMBER
    B NUMBER
    C DATE


    select partition_name from user_tab_partitions where table_name ='MONTH_PART'

    APR10
    MAY10
    JUN10
    SYS_P25
    SYS_P21
    SYS_P24
    SYS_P22
    SYS_P23


    SQL> select distinct (c) from month_part partition SYS_P22;

    select distinct (c) from month_part partition SYS_P22
    *
    ERROR at line 1:
    ORA-00933: SQL command not properly ended

  4. #4
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    select distinct (c) from month_part partition (SYS_P22)

  5. #5
    Join Date
    Jul 2006
    Posts
    195
    thanks those F#&*!(& parentisis

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