Hi Simon, Yeah, I thought of the query which u mentioned. But the problem is overhead is too much.
I was wondering why SQL doesn't support something like: Select COUNT (DISTINCT year, month) FROM table when it supports: select COUNT (DISTINCT year) FROM table Regards, Phani -----Original Message----- From: Simon Davies [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 25, 2007 4:09 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] select COUNT (DISTINCT column1, column2) from table? On 25/09/2007, B V, Phanisekhar <[EMAIL PROTECTED]> wrote: > Hi Simon, . . > Here I > need to find the number of distinct combinations of year, month not the > count for a particular year, month. > > Regards, > Phani > SQLite version 3.4.2 Enter ".help" for instructions sqlite> sqlite> create table m( mNo integer, year integer, month integer ); sqlite> sqlite> insert into m values (1, 2006, 11 ); sqlite> insert into m values (2, 2007, 5 ); sqlite> insert into m values (3, 2007, 5 ); sqlite> insert into m values (4, 2007, 6 ); sqlite> sqlite> select count(*) from ( select * from m group by year, month ); 3 sqlite> Rgds, Simon ------------------------------------------------------------------------ ----- To unsubscribe, send email to [EMAIL PROTECTED] ------------------------------------------------------------------------ ----- ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------