SELECT QuoteID from Quotes q
LEFT JOIN Orders o
ON q.QuotedID = o.QuoteID
WHERE o.QuoteID IS NULL
AND q.Booked='Y'
HTH,
Tony
> -----Original Message-----
> From: Dr John Tankard [mailto:john@xxxxxxx]
> Sent: 02 October 2002 15:08
> To: ukha_d@xxxxxxx
> Subject: [ukha_d] OT SQL Question ?
>
>
> I have left my SQL ref at home
>
> Two tables Quotes & Orders
>
> Quotes
> ------
> QuoteID
> Booked(y/n)
>
> Orders
> ------
> OrderID
> QuoteID
>
> I want to list all Quotes that Booked = T that dont exist in Orders
?
>
> I know I need a subquery and a IN or Exist but canntot remember how
> to form it
>
> John
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Sell a Home for Top $
> http://us.click.yahoo.com/RrPZMC/jTmEAA/MVfIAA/IBOolB/TM
> --------------------------------------------------------------
> -------~->
>
> http://www.automatedhome.co.uk
> Post message: ukha_d@xxxxxxx
> Subscribe: ukha_d-subscribe@xxxxxxx
> Unsubscribe: ukha_d-unsubscribe@xxxxxxx
> List owner: ukha_d-owner@xxxxxxx
>
> List of UKHA Groups here - http://groups.yahoo.com/group/UKHA_Grouplists/
********************************************************************
Visit our Internet site at http://www.rbsmarkets.com
This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
Regulated by the Financial Services Authority
********************************************************************
Comments to the Webmaster are always welcomed, please use
this contact form
. Note that as this site is a mailing list archive, the Webmaster has no control
over the contents of the messages. Comments about message content should be directed
to the relevant mailing list.