Re: COUNT UNIQUE

2002-03-04 Thread Peter Duffy
In recent versions, you can do "select count(distinct theCol) ..." (I'm actually running one at this moment!!) On Mon, 2002-03-04 at 09:34, Rob wrote: > Given a table with some non-unique column theCol, what is the most efficient > way to count the number of different values in theCol? I guess

Re: COUNT UNIQUE

2002-03-04 Thread Joseph Bueno
Rob wrote : > > Given a table with some non-unique column theCol, what is the most efficient > way to count the number of different values in theCol? I guess you can use a > temporary table as a subselect: > > CREATE TEMPORARY TABLE tmp SELECT UNIQUE theCol FROM theTable; > SELECT COUNT(*) FROM

COUNT UNIQUE

2002-03-04 Thread Rob
Given a table with some non-unique column theCol, what is the most efficient way to count the number of different values in theCol? I guess you can use a temporary table as a subselect: CREATE TEMPORARY TABLE tmp SELECT UNIQUE theCol FROM theTable; SELECT COUNT(*) FROM tmp; DROP TABLE tmp; But t