On 12 Dec 2012, at 2:26pm, Frank Chang <frankchan...@gmail.com> wrote:

>  Hello, In the latest version of SQLite, is there any subtle distinction
> between UNIQUE and DISTINCT? If there exists a subtle distinction between
> UNQUE and DISTINCT in Sqlite, what is the appropriate Insert or replace
> syntax, CREATE INDEX usage, and the SELECT statements? Thank you.

Although the English words have similar meanings, these words are used 
differently in SQLite.

UNIQUE is used when you define criteria or indexes to make sure you can't 
insert conflicting entries in a table.

DISTINCT is used in a SELECT when looking at data which already exists, when 
you just need to know whether there are any entries or no entries for something.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to