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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Puzzle ...

Re: SQL Puzzle ...

From: Van Messner <vmessner_at_netaxis.com>
Date: Mon, 16 Nov 1998 21:32:23 -0500
Message-ID: <6i542.75$G3.1152@news14.ispnews.com>


Hello Manoj:

    Wouldn't this cause problems trying to compare columns with null values? Could you get around the difficulty by combining you statement with NVL()s?

Van

mjain_at_my-dejanews.com wrote in message <72p13l$4vp$1_at_nnrp1.dejanews.com>...
>** A copy of this message is also being sent to <kraghu_at_india.hp.com>
>
>Raghu,
>
>Suppose you have a table named Table_A
>with three columns named as:
>
>Col_1, Col_2 and Col_3 respectively.
>
>Then you can use following query to delete
>duplicate rows from the table Table_A:-
>
>DELETE FROM Table_A A
>WHERE A.rowid > ( SELECT MIN (B.rowid)
> FROM Table_A B
> WHERE B.Col_1 = A.Col_1
> AND B.Col_2 = A.Col_2
> AND B.Col_3 = B.Col_3 );
>
>Hoope this helps,
>
>Let me know if it worked for you, thanks!!
>
>Manoj Jain
>Oracle Certified Professional - OCP DBA
>Chauncey Certified Oracle7 DBA
>
>16-November-1998
>
>
>In article <364F9289.1629E71B_at_india.hp.com>,
> "K. Raghuraman" <kraghu_at_india.hp.com> wrote:
>> Hi,
>>
>> I have a table with three columns and no keys defined. I want to
>> eliminate only the duplicate records from the table in a single SQL
>> delete statement. How do I construct my SQL statement ?
>>
>> Thanks and Regards,
>>
>> Raghu
>>
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Mon Nov 16 1998 - 20:32:23 CST

Original text of this message

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