Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Max Vlasov
On Sat, Jun 26, 2010 at 7:27 AM, zhangzhenggui wrote: > tbl_test maybe like this: > create table tbl_test(f1, f2, f3); > > Now, I want to get the num of records which (f1, f2) are distinct. > > I try "select count(distinct f1, f2) from tbl_test", but error occur: SQL > error: wrong number of argum

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Roger Andersson
> >> Now, I want to get the num of records which (f1, f2) are distinct. > >> > > Maybe something like > > SELECT f1,f2,count(*) FROM tbl_test GROUP BY f1,f2; > > That would return, for each (f1, f2) bucket, the number of > records that fall into this bucket. That doesn't sound like > what the O

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Igor Tandetnik
Roger Andersson wrote: >> Ämne: [sqlite] Why "select count(distinct f1, f2) from >> tbl_test" can not work? >> >> Now, I want to get the num of records which (f1, f2) are distinct. >> > Maybe something like > SELECT f1,f2,count(*) FROM tbl_test GR

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Igor Tandetnik
zhangzhenggui wrote: > Now, I want to get the num of records which (f1, f2) are distinct. > > although, I can do like this, but I think it not very good : > select count(1) from (select distinct f1, f2 from tbl_test); What makes you think it's "not very good"? What do you feel is the problem wit

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Roger Andersson
> Ämne: [sqlite] Why "select count(distinct f1, f2) from > tbl_test" can not work? > > tbl_test maybe like this: > create table tbl_test(f1, f2, f3); > > Now, I want to get the num of records which (f1, f2) are distinct. > > I try "select count(dis