Navigation
|
|
|
| |
Snippet Library
|
|
|
| |
Blog Archive
|
|
|
| |
Random Affiliates
|
|
|
|

|
Snippet Library |
|
SQL - Structured Query Language (.sql) |

|

|
| Remove Duplicate Rows from a Database |

|
| |
|
The following SQL example shows you how to eliminate all duplicate rows from a table. This example will only work with a table which has at least one column that is unique for every row. In this example the SQL will remove all rows that have duplicate cust_email's in another row. This example keeps the row with the minimum cust_id which happens to be the primary key for this particular table and then eliminates the duplicate rows that have the same cust_email but different cust_id. The key to solving this problem is to pick a column that is unique for every row and a column that you want to eliminate duplicates for. Then all you need to do is substitute these values in the example below. I am currently working on a solution which will work with multiple columns which I will post later this month. |
|
| |
| |
|
| |
| Go Back |
|

|
Advertisements
|

|