db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: How to COUNT DISTINCT over multiple columns ?
Date Mon, 19 Dec 2005 10:58:02 GMT
>>>>>>>>>>>> Thomas Dudziak wrote (2005-12-18 17:09:35):
> On 12/18/05, Bernt M. Johnsen <Bernt.Johnsen@sun.com> wrote:
> 
> > You're just missing a small detail:
> >
> > select count(*) from (select distinct person_id, project_id from person_project)
as t(a,b);
> 
> Yup, thanks, that works!
> But is there any chance for support for
> 
>   SELECT COUNT(DISTINCT person_id, project_id) FROM person_project ?
> 
> would make things a lot easier for us :-)

Don't think many databases has implemented COUNT(<row value expression>)

although it has been in the SQL standard since '92. 

COUNT(DISTINCT col) works, though


> regards,
> Tom

-- 
Bernt Marius Johnsen, Database Technology Group, 
Sun Microsystems, Trondheim, Norway

Mime
View raw message