Select Distinct in SQL is used to remove the duplicate data from the table. SQL DISTINCT Keyword is used along with the SELECT statement
The SQL Distinct syntax is as follows:
SELECT DISTINCT column1, column2…. FROM table_name WHERE [condition];
Consider the Student_details table:
Now we want to see the marks of the students and duplicate values will no display.
SELECT DISTINCT Marks FROM Student_details ORDER BY Marks;
Download Interview Questions asked by top MNCs in 2019?