List:General Discussion« Previous MessageNext Message »
From:Richard Reina Date:May 30 2001 7:44pm
Subject:Re: SELECT question.
View as plain text  
Thank you to all who responded.  A left join was definately the answer.

Richard

Roger Karnouk wrote:
> 
> Try this
> 
> SELECT l.load_no l.date FROM loads l left join invoice i
> on (l.load_no = i.load_no)
> where i.load_no is null
> AND l.dlvr_date > 0;
> 
> -----Original Message-----
> From: Richard Reina [mailto:Richard@stripped]
> Sent: Wednesday, May 30, 2001 12:42 PM
> To: mysql@stripped
> Subject: SELECT question.
> 
> I am stuck on a select query and was wondering if someone could help.  I
> have I've written a database app. that helps me run my business
> (trucking).  I need however to write a query that shows me all of the
> loads that are delivered but not billed (invoiced).  Which means that I
> have to select the loads that are delivered but do not have an entry in
> the INVOICED table -- since an entry is made in the INVOICED table
> whenever a load is billed.
> 
> I know the query below won't work.  Can someone please help me fix it?
> 
> SELECT l.load_no l.date FROM loads l, invoiced i
> WHERE l.dlvr_date > 0
> AND l.load_no != i.load_no
> 
> Thanks,
> 
> Richard
> 
> ---------------------------------------------------------------------
> 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-thread75063@stripped>
> To unsubscribe, e-mail
> <mysql-unsubscribe-roger=mediahouse.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Thread
SELECT question.Richard Reina30 May
  • Re: SELECT question.Rafal Jank30 May
  • RE: SELECT question.Ravi Raman30 May
  • Re: SELECT question.Mohammad Shoja30 May
  • Re: SELECT question.Paul DuBois30 May
    • Re: SELECT question.Scott Alexander31 May
RE: SELECT question.Gregert Johnson30 May
Re: SELECT question.Richard Reina30 May