How can I do a count distinct in sqlite?

My quick google with the terms "count unique values sqlite3" landed me on this post. However, I was trying to count the overall number of unique values, instead of how many duplicates there are for each category.

From Chris's result table above, I just want to know how many unique colors there are. The correct answer here would be four [4].

This can be done using select count(DISTINCT type) from table;


A quick google gave me this: http://www.mail-archive.com/[email protected]/msg38339.html

select type, count(type) from table group by type;