InterviewSolution
Saved Bookmarks
| 1. |
How to find duplicate records in a table? |
|||||||||||||||||||||||
|
Answer» The DISTINCT statement or GROUP BY statement can be USED to identify duplicate records in a table. SELECT DISTINCT column 1, column 2... FROM TABLENAME;OR SELECT column 1, column 2,... FROM tablename GROUP BY column 1, column 2....;Example: CONSIDER the FOLLOWING student table.
DISTINCT Here is an example of a DISTINCT statement. SELECT DISTINCT First_Name FROM tablename;Output: Following is the output of the above query when executed. With a distinct statement, duplicate values can be eliminated.
|
||||||||||||||||||||||||