On 05/11/2007, A.J.Millan <[EMAIL PROTECTED]> wrote:
> I All:
>
> Suppose a table:
>
> CREATE TABLE 'myTable' (
> A INTEGER NOT NULL,
> B INTEGER NOT NULL,
> C INTEGER);
>
> Do is there some query to return if there are some duplicate files and/or
> who are they?
>
> Consider duplicate file if there are two or more rows with the same values.
> I.E:
>
> two or more with same values A=X, B=Y, C=Z
>
> or
>
> A= X, B=Y, C=NULL
>
> for any 3-tuple X Y Z
>
> Thanks in advance.
>
Hi AJM,
I use:
select rowid, A, B, C
from t
where A||B||C in
( select A||B||C
from t
group by A, B, C
having count(*)>1
);
and in order to delete duplicated rows,
delete from t
where A||B||C in
( select A||B||C
from t
group by A, B, C
having count(*)>1
) and
rowid not in
( select min(rowid)
from t
group by A, B, C
having count(*)>1
);
Rgds,
Simon
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------