Subject | Re: [Firebird-Java] Eliminar Registros Duplicados |
---|---|
Author | Bruno Reato |
Post date | 2011-11-24T15:41:05Z |
Try with this sql:
Example table structure:
Table name: TABLE_EXAMPLE
Fields: ID, FIELD1, FIELD2, FIELD3
DELETE FROM TABLE_EXAMPLE
WHERE TABLE_EXAMPLE.ID IN (SELECT MAX(TABLE_EXAMPLE.ID)
FROM TABLE_EXAMPLE
GROUP BY FIELD1, FIELD2,
FIELD3)
If you have problems with performance of delete statement you should try
convert it into a stored procedure.
Bye.
Bruno.
[Non-text portions of this message have been removed]
Example table structure:
Table name: TABLE_EXAMPLE
Fields: ID, FIELD1, FIELD2, FIELD3
DELETE FROM TABLE_EXAMPLE
WHERE TABLE_EXAMPLE.ID IN (SELECT MAX(TABLE_EXAMPLE.ID)
FROM TABLE_EXAMPLE
GROUP BY FIELD1, FIELD2,
FIELD3)
If you have problems with performance of delete statement you should try
convert it into a stored procedure.
Bye.
Bruno.
[Non-text portions of this message have been removed]