Re: select count (distinct X, Y)

From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 02/08/05


Date: Tue, 08 Feb 2005 12:04:58 +0100

On Tue, 8 Feb 2005 02:29:03 -0800, Ronan wrote:

>I'm trying to make this query:
>select count (distinct UC_CODE, SYNT, SUPER)
>FROM PLAN_RB
>WHERE HYPER IS NULL
>AND SUPER IS NOT NULL
>
>and I have this message:
>Incorrect syntax near ','
>
>What I want to find is the total number of lines...

Hi Ronan,

Here's a workaround, using a derived table:

SELECT COUNT(*)
FROM (SELECT DISTINCT UC_Code, Synt, Super
       FROM Plan_DB
       WHERE Hyper IS NULL
       AND Super IS NOT NULL) AS Der
(untested)

Best, Hugo

-- 
(Remove _NO_ and _SPAM_ to get my e-mail address)