The SQLite DISTINCT clause is used with SELECT statement to eliminate all the duplicate records and fetching only unique records.
It is used when you have multiple duplicate records in the table.
SELECT DISTINCT column1, column2,.....columnN FROM table_name WHERE [condition]
We have a table named "STUDENT", having the following data:
First Select NAME from "STUDENT" without using DISTINCT keyword. It will show the duplicate records:
SELECT NAME FROM STUDENT ;
Now, select NAME from "STUDENT" using DISTINCT keyword.
SELECT DISTINCT NAME FROM STUDENT;