List:General Discussion« Previous MessageNext Message »
From:Amro Hassanin Date:October 11 2001 2:22am
Subject:Re: problem with relational query
View as plain text  
I'd suggest something like this

SELECT make.make, model.model FROM application INNER JOIN  make ON
make.id = application.make INNER JOIN model ON model.id =
application.model WHERE (application.year_in <= 1962 AND
application.year_out >= 1962) ORDER BY make.make;
 
hope this helps

Amro

Tom Beidler wrote:
> 
> I have three databases; application, make and model. I'm trying to write a
> query that would find all applications for a given year and then pull up the
> results. The application database lists makes and models by a related id
> from the make and model database. Here's my query;
> 
> SELECT make.make, model.model FROM application, make, model WHERE make.id =
> application.make AND model.id = application.model AND (application.year_in
> <= 1962 AND application.year_out >= 1962) ORDER BY make.make
> 
> I'm getting some crazy results.
> 
> Any help would be appreciated.
> 
> Tom
> 
> ---------------------------------------------------------------------
> 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 <mysql-thread87607@stripped>
> To unsubscribe, e-mail <mysql-unsubscribe-amro=egyptsport.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Thread
problem with relational queryTom Beidler11 Oct
  • Re: problem with relational queryAmro Hassanin11 Oct