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
> >> 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
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
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
> Ä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
5 matches
Mail list logo