SQL TIP: To DELETE the records having the duplicate key values
Page 1 of 1
SQL TIP: To DELETE the records having the duplicate key values
For example to delete the employee records having the same employee code
DELETE FROM EMPMST A WHERE RRN(A) > (SELECT MIN(RRN(B)) FROM EMPMST B WHERE B.EMPCDE = A.EMPCDE)
DELETE FROM EMPMST A WHERE RRN(A) > (SELECT MIN(RRN(B)) FROM EMPMST B WHERE B.EMPCDE = A.EMPCDE)
Similar topics
» SQL TIP: UPDATE THE PARTICULAR COLUMN WITH ANY ONE OF SEVERAL VALUES USING CASE
» CLRPFM Vs DELETE (SQL DELETE)
» DLTF need to perform other than delete
» SQL TIP: To find out the N th highest and N th lowest values from table.
» SQL TIP: VALUES CLAUES CAN BE USED TO ENCAPSULATE SEVERAL INDEPENDENT QUERIES
» CLRPFM Vs DELETE (SQL DELETE)
» DLTF need to perform other than delete
» SQL TIP: To find out the N th highest and N th lowest values from table.
» SQL TIP: VALUES CLAUES CAN BE USED TO ENCAPSULATE SEVERAL INDEPENDENT QUERIES
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|