db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khin, Gerald" <Gerald.K...@ids-scheer.com>
Subject AW: How to COUNT DISTINCT over multiple columns ?
Date Sun, 18 Dec 2005 12:38:39 GMT

> [...]
> Interestingly, the workaround of
> 
>   SELECT COUNT(*) FROM (SELECT DISTINCT person_id, project_id FROM
> person_project);
> 
> doesn't work either, I get a
> 
>  ERROR 42X01: Syntax error: Encountered "<EOF>" at line 1, column 80.
>
> Is there a way to achieve this with Derby ?

Try this one:

SELECT COUNT(*) FROM (SELECT DISTINCT person_id, project_id FROM person_project) kludge;

Regards
Gerald


Mime
View raw message