Dirk Lutzebaeck <[EMAIL PROTECTED]> writes:
> Michael Fork writes:
>>> In 7.0.3, I believe the following would work:
>>>
>>> SELECT count(distinct(a || b)) FROM t;
> Great, this works! I don't quite get it why...
Michael really should not have proposed that solution without mentioning
its limit
Michael Fork writes:
> In 7.0.3, I believe the following would work:
>
> SELECT count(distinct(a || b)) FROM t;
Great, this works! I don't quite get it why...
Dirk
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send
Dirk Lutzebaeck <[EMAIL PROTECTED]> writes:
> on 7.0.3 want to COUNT
> SELECT DISTINCT a,b FROM t;
In 7.1 you could do
select count(*) from (select distinct a,b from t) as t1;
In 7.0 and before I think you have no choice but to use a temp table.
regards, tom l
In 7.0.3, I believe the following would work:
SELECT count(distinct(a || b)) FROM t;
if subselects in from were supported in 7.0.3 as they are in 7.1, you
could do:
SELECT count(*) FROM (SELECT DISTINCT a,b FROM t) FROM x
Michael Fork - CCNA - MCP - A+
Network Support - Toledo Internet Access
Title: RE: [SQL] counting distinct rows on more than one column
SELECT count(*) FROM (SELECT DISTINCT a, b FROM t) AS t2;
should give you what you want.
MikeA
>> -Original Message-
>> From: Dirk Lutzebaeck [mailto:[EMAIL PROTECTED]]
>> Sent: 28 March 2001 1
Hi,
on 7.0.3 want to COUNT
SELECT DISTINCT a,b FROM t;
I can't find a solution because any combination with
count with more than one column gives syntax errors.
One solution would be to set a view:
CREATE VIEW v AS SELECT DISTINCT a,b FROM t;
and then
SELECT count(a) FROM v
but views do