Do you want the unique records, not all records?

You can get the unique records with the DISTINCT clause.

Use the SELECT query together with the DISTINCT clause to get all the unique records from a table.

You may like:
Learning SQL: Master SQL Fundamentals

DISTINCT clause

Syntax

You can select all records from a table using this query

1
SELECT * FROM table;

To get the unique records, use this:

1
SELECT DISTINCT column FROM table;

This will return all unique records for that column.
To get the unique records, you must specify at least one column.

Example

If you have a table students, you can use the select query to get all records:

1
2
3
4
5
6
7
8
sqlite> SELECT * FROM students;
1|Alice|1000.0
2|Bob|2000.0
3|Chris|3000.0
4|David|2500.0
5|Bob|1500.0
6|Kacey|2500.0
7|Chris|2500.0

To get unique records use:

1
2
3
4
5
6
sqlite> SELECT DISTINCT name FROM students;
Alice
Bob
Chris
David
Kacey

Video

Video demonstration of DISTINCT clause