00 Votes

SQLite: Exclude duplicate records from result

Question by Compi | 2017-10-27 at 03:59

Is SQLite offering any possibility for excluding all double data records from the result of a query?

I am using some usual SELECT-request like this one:

SELECT dat FROM tab

This query returns all records from the column "dat", some of them can be duplicates. I do not want to have for them in my search results.

ReplyPositiveNegative
0Best Answer0 Votes

You can just use the magic word "DISTINCT". This keyword ensures that all double records will be excluded from the results.

Your query from above would look like this:

SELECT DISTINCT dat FROM tab

You have to write the "DISTINCT" directly after the "SELECT".
2017-10-27 at 09:24

ReplyPositive Negative
Reply

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.