How to delete duplicate records with condition

2003-01-07 Thread roland . skoldblom
Hallo,

I have this sql,

SELECT * FROM varukorgtmp
where varukorgid= 120 That makes the result of this testfile.xls


(See attached file: start.xls)

There are two values in EAN-field, which are the same
23324614 in row 2 and 3

Now I want in an sql script to check out which are the duplicates of EAN in that 
table. Then then the script will check which is VARUTYP = 3, then delete the record(s) 
which have VARUTYP =3.

So the result should be like this, with only two rows left in this case).


(See attached file: result.xls)

I would really appreciate if anyone could help me with this sql  I have tried several 
sql, but with no luck.

Thanks in advance

Roland












start.xls
Description: application/msexcel


result.xls
Description: application/msexcel


Re: How to delete duplicate records with condition

2003-01-07 Thread MURAT BALKAS

Hi,

  following metalink documents may help you.

Note:65080.1  Using SQL To Delete Duplicate Rows In A Table

PR:1015631.6  HOW TO SELECT DUPLICATE ROWS WITHOUT USING ROWID

PR:1004425.6  HOW TO FIND OR DELETE DUPLICATE ROWS IN TABLE

Murat



   

  roland.skoldblom@

  ica.se   To:   Multiple recipients of list 
ORACLE-L [EMAIL PROTECTED]   
  Sent by: cc: 

  [EMAIL PROTECTED] Subject:  How to delete duplicate 
records with condition
   

   

  01/07/2003 03:28 

  PM   

  Please respond to

  ORACLE-L 

   

   





Hallo,

I have this sql,

SELECT * FROM varukorgtmp
where varukorgid= 120 That makes the result of this testfile.xls


(See attached file: start.xls)

There are two values in EAN-field, which are the same
23324614 in row 2 and 3

Now I want in an sql script to check out which are the duplicates of EAN in
that table. Then then the script will check which is VARUTYP = 3, then
delete the record(s) which have VARUTYP =3.

So the result should be like this, with only two rows left in this case).


(See attached file: result.xls)

I would really appreciate if anyone could help me with this sql  I have
tried several sql, but with no luck.

Thanks in advance

Roland









(See attached file: start.xls)(See attached file: result.xls)





start.xls
Description: application/msexcel


result.xls
Description: application/msexcel


Delete duplicate records with condition

2003-01-07 Thread roland . skoldblom

Hallo,

I have this sql,

SELECT * FROM varukorgtmp
where varukorgid= 120 That makes the result of this testfile.xls


(See attached file: start.xls)

There are two values in EAN-field, which are the same
23324614 in row 2 and 3

Now I want in an sql script to check out which are the duplicates of EAN in that 
table. Then then the script will check which is VARUTYP = 3, then delete the record(s) 
which have VARUTYP =3.

So the result should be like this, with only two rows left in this case).


(See attached file: result.xls)

I would really appreciate if anyone could help me with this sql  I have tried several 
sql, but with no luck.

Thanks in advance

Roland



start.xls
Description: application/msexcel


result.xls
Description: application/msexcel