DISTINCT clause in SQLite

Posted by Eye of Hell on Stack Overflow See other posts from Stack Overflow or by Eye of Hell
Published on 2010-06-14T15:38:59Z Indexed on 2010/06/14 15:42 UTC
Read the original article Hit count: 209

Filed under:

Hello.

Recently i found that SQLite don't support DISTINCT ON() clause that seems postgresql-specific. For exeample, if i have table t with columns a and b. And i want to select all items with distinct b. Is the following query the only one and correct way to do so in SQLite?

select * from t where b in (select distinct b from t)

© Stack Overflow or respective owner

Related posts about sqlite