Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Newbie PL/SQL question

Re: Newbie PL/SQL question

From: Ulrik Hoffmann <ulrik_at_hoffmann-kiel.de>
Date: 1999/10/06
Message-ID: <7tgd1q$9c3$1@news.comcity.de>#1/1

Hi,

a better way would be using the following SQL-Statement:

select ID from sample s1 where
  s1.dnumber, s1.year, s1.num, s1.dte in (select s2.dnumber, s2.year, s2.num, s2.dte   from sample s2
  having count(*) > 1
 group by
s2.dnumber, s2.year, s2.num, s2.dte)

Hope that helps,

bye
Uli

>
> My current program (has errors) looks like this:
>
> SET serveroutput on;
> DECLARE
> CURSOR sample_curs IS
> select DNUMBER, YEAR, NUM, DTE from SAMPLE;
> row_var sample_curs%ROWTYPE;
> count_var number(2);
> id_var SAMPLE.ID%TYPE;
> What's the best way to output the IDs of the rows with dup columns?
Received on Wed Oct 06 1999 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US