On 25/09/2007, B V, Phanisekhar <[EMAIL PROTECTED]> wrote: . . > Assume you have a following data: > > matchNo, year, month > > 34 2007 9 > > 27 2006 5 > > 26 2006 5 > > Now distinct year, month will return > > 2007, 9 > > 2006, 5 > > Is there a way by which I can count (distinct year, month) combinations? > For this example answer should be 2. > > Regards, > > Phani
Hi 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> sqlite> select count(*), year, month from m group by year,month; 1|2006|11 2|2007|5 sqlite> Rgds, Simon ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------