The ROWIDs are then returned to the DELETE statement at the top, which only deletes records where the ROW_NUMBER function (which has an alias of “dup” in this example) are greater than one. The second occurrence of all of those fields will get a number of 2, and so on. This means that the first occurrence of those fields will get the number of 1. It uses the PARTITION BY to create partitions or groups based on the fields I’ve mentioned in the PARTITION BY (which are first_name, last_name, and created_date). The ROW_NUMBER function here is used as an analytic function. (PARTITION BY unique_columns ORDER BY ROWID) dup The query looks like this: DELETE FROM table a
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |