Re: how to make this query? Please help me
Date: Fri, 26 Nov 1999 11:07:44 +0100
Message-ID: <383E5BF0.4B792840_at_beusen.de>
Maiko schrieb:
> I've 2 tables:
>
> shows and dates with the following contents:
>
> SHOWS:
>
> id name
> 1 showa
> 2 showb
> 3 showc
>
> DATES:
>
> id showid date
> 1 1 25-11-1999
> 2 1 30-11-1999
> 3 2 24-11-1999
> 4 2 27-11-1999
>
> We want the output of a query ordered by date and grouped by showname,
> ie
>
> showb 24-11-1999
> 27-11-1999
> showa 25-11-1999
> 30-11-1999
>
> Please help me out, and tell me how to do this in SQL. It's very
> urgent for me so any help will be very appreciated.
>
select shows.name, dates.date
from
dates,
shows
where dates.showid = shows.id
order by shows.name, dates.date
This statement does NOT hide the showname as showed in your example if
there are more than one show....
but it orders the result first by showname and within the show by date.
Hope, that will help you, let me know, please.
Regards, Stephan
-- --------------------------------------------------------------- Dipl.-Inf. (FH) Stephan Born | beusen Consulting GmbH fon: +49 30 549932-0 | Landsberger Allee 392 fax: +49 30 549932-29 | 12681 Berlin mailto:stephan.born_at_beusen.de | Germany --------------------------------------------------------------- PGP-Key verfügbar | PGP-Key available ---------------------------------------------------------------Received on Fri Nov 26 1999 - 11:07:44 CET