Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    5

    Unanswered: basic PL/SQL question

    Okay,

    kinda new at this:


    I have Id's that can have duplicates. I also have programs that can have duplicates. I am looking for a list of IDs with programs that have a rowcount > 1 for that given id.


    Example

    ID Program
    --- ----------
    111 12345 <----------These are the records I want
    111 12345 <----------
    222 32145
    333 99999
    444 55555
    444 66666



    with my current query I keep getting 1 ID per 1 Program?


    What PL/SQL do I need?


    Thanks in advance!

    J

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: basic PL/SQL question

    Not PL/SQL, just SQL:

    select id, program, count(*)
    from x
    group by id, program
    having count(*) > 1;

Posting Permissions

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