开发者

How to Distinct one column from all the column that i choose in Sqlite

How to Distinct one column from all the column that i choose in Sqlite?

Thanks for 开发者_Python百科helping


If you're only selecting one column, it's easy:

SELECT DISTINCT col1 FROM table

If you mean you're selecting multiple columns, but only one want one of them to be distinct you can do:

SELECT col1 , col2 , col3 FROM table GROUP BY col1

Obviously you need to be careful about whether this means you're going to miss some data from col2 and col3 that you need. Sometimes it's better to select more and filter client-side instead.


Use the DISTINCT keyword in your query :

SELECT DISTINCT column FROM table

Hope this helps,

Phil Lello

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜