Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    18

    Unanswered: problem on distinct...please help me..

    Hi..

    I have list of data as below:-

    Code:
    select source_ident from albn_rnokia01_463199;
    ECS.NOKGLB._VIDAST_CF0263.D04
    ECS.NOKGLB._VIDAST_CF0275.D04
    ECS.NOKGLB._VIDAST_CF0279.D04
    ECS.NOKGLB._VIDAST_CF0280.D04
    ECS.NOKGLB._VIDAST_CF0281.D04
    ECS.NOKGLB._VIDAST_CF0281.D04
    ECS.NOKGLB._VIDAST_CF0282.D04
    ECS.NOKGLB._VIDAST_CF0282.D04
    ECS.NOKGLB._VIDAST_CF0282.D04
    ECS.NOKGLB._VIDAST_CF0285.D04
    ECS.NOKGLB._VIDAST_CF0285.D04
    ECS.NOKGLB._VIDAST_CF0285.D04
    ECS.NOKGLB._VIDAST_CF0285.D04
    But, why after i execute the distinct query it is still display the duplicate record ?.. the query as below:-

    Code:
    select distinct(source_ident),rownum from albn_rnokia01_463199 order by rownum;
    ECS.NOKGLB._VIDAST_CF0263.D04	1
    ECS.NOKGLB._VIDAST_CF0275.D04	2
    ECS.NOKGLB._VIDAST_CF0279.D04	3
    ECS.NOKGLB._VIDAST_CF0280.D04	4
    ECS.NOKGLB._VIDAST_CF0281.D04	5
    ECS.NOKGLB._VIDAST_CF0281.D04	6
    ECS.NOKGLB._VIDAST_CF0282.D04	7
    ECS.NOKGLB._VIDAST_CF0282.D04	8
    ECS.NOKGLB._VIDAST_CF0282.D04	9
    ECS.NOKGLB._VIDAST_CF0285.D04	10
    ECS.NOKGLB._VIDAST_CF0285.D04	11
    ECS.NOKGLB._VIDAST_CF0285.D04	12
    ECS.NOKGLB._VIDAST_CF0285.D04	13
    As your information, my ODI will be keep looping reading the record based on rownum untill end of record...

    Thank you,
    Baharin

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by bh_hensem View Post
    select distinct(source_ident),rownum ...
    there's your problem right there

    DISTINCT is ~not~ a function

    putting the first column after the keyword DISTINCT in parentheses does nothing

    DISTINCT applies to all columns in the SELECT clause, i.e. the entire row

    since each rownum is different, therefore each entire row is different

    make sense?

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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