Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Please Help With SQL
SELECT BANDID, COUNT(TITLES)
FROM ALBUMS
GROUP BY BANDID
HAVING COUNT(TITLES) = 2;
"Alison Pont" <aPont8892_at_hotmail.com> wrote in message
news:a6m064$1pl$1_at_slb0.atl.mindspring.net...
> Table Bands with columns:
> BandId, BandName
>
> Table Albums with columns:
> AId, BandId, Title, YearProduced
>
> How do find all bands that recorded TWO albums in the same year? I want to
> output BandName and the names of each of two albums (the Tiltles) in the
> same record.
>
> eg.
> BandName Title Title YearProduced
> ----------------------------------------------------------
> Bread BestHits1 BestHits2 1982
> James Last Classic1 Classics2 1988
>
> Thanks in advance.
>
>
>
>
Received on Tue Mar 12 2002 - 15:44:33 CST