Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2012

    Unanswered: Unique ones and one random record


    I want to make the following select on Oracle PL/SQL:

    I have two columns ServedIMSI, Servicekey. There are many servicekey dublicates, so I want to select only the unique ones and one random record for ServedIMSI that matches on the number of the servicekey . Is there a way to do that ?

  2. #2
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 5
    Aggregation per SERVEDIMSI column (such as MAX or MIN) will return just one SERVEDIMSI for distinct SERVICEKEY values. As you said that "random" is OK, it doesn't matter whether it is MAX or MIN (or any other you find useful).
    select servicekey, max(servedimsi) 
    from your_table
    group by servicekey

Posting Permissions

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