Hi Carsten,
Thanks. Your close.

Im searching on depart and arrive - not the times. so I want to go from Los
Angeles to NewYork.
So the standard query would be -

SELECT depart, arrive
FROM flights
WHERE depart = 'LA' OR arrive = 'NY';

Now from this query I should have all of the records where depart contains
"LA" and all of the arrive records that contain "NY". So the last step is to
match the depart and arrive using the flight_group.

So this is where I'm stuck

I'm not sure how to add -

WHERE t1.flight_group = t2.flight_group;

That you suggested in your previous post.


Thanks,

- Tom Jones
[EMAIL PROTECTED]



----- Original Message -----
From: "Carsten H. Pedersen" <[EMAIL PROTECTED]>
To: "Tom Jones" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, January 12, 2002 15:35
Subject: RE: Select statement help...


> > Hello,
> > I've been trying to figure this out but I feel like I'm just
> > banging my head
> > on the wall.
>
> That must be quite painful...
>
> > I hope this is the right forum to pose this question.
>
> It's certainly one of the better ones, yes.
>
> > I have a table of flights which has several fields
> >
> > >Table: flights
> > >Fields: depart, depart_time, arrive, arrive_time, flight_no,
flight_group
> >
> > I'm trying to do a search on "depart" and "arrive" and show only
> > the records
> > which have matching "flight_group"
>
> You're not providing a lot of information. Is it something
> like this, you're looking for:
>
> SELECT t1.depart_time, t2.arrive_time
> FROM flights AS t1, flights AS t2
> WHERE t1.flight_group = t2.flight_group;
>
> / Carsten
> --
> Carsten H. Pedersen
> keeper and maintainer of the bitbybit.dk MySQL FAQ
> http://www.bitbybit.dk/mysqlfaq
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to