| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Counting propositions
>> In fact, there ought never be any need to do 'distinct' at all. <<
Which theaters in my multiplex are showing (n) films all the time?
SELECT theater_nbr, MAX(movie_title)
FROM MultiplexSchedule
GROUP BY theater_nbr
HAVING COUNT(DISTINCT movie_title) = :n;
It is a good shorthand for situation which would otherwise require (SELECT DISTINCT...) AS X(..) derived tables and a few layers of nesting. Received on Sun Jun 20 2004 - 18:59:45 CDT
![]() |
![]() |