Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Similar Rows...
hi
spool c:\filename (or whatever you want)
select code, count(*) from table_name group by code having count(*) > 1
hth
SL
Florent schrieb:
> Hi,
> I don't know if this has been asked, (sorry if it has ),but I need to
> find 2(or more) rows that are similar,
> so if I have
> NAME / CODE
> A 0
> B 0
> C 1
>
> and NAME is my primary key, what script can I use to tell that A and B
> are similar based on CODE,
> If I do SELECT * FROM MY_TABLE WHERE CODE = 0; that 's would give me A
> and B but what if I don't know what code is, I need a script that would
> tell me A and B because CODE is the same regardless of the value.
>
> And last but not least, how do I send the result to a file in SQLPlus.
>
> Thanks in advance
> Florent
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Thu Nov 02 2000 - 09:25:40 CST