Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with SQL Select Statement

Status
Not open for further replies.

maxf

Programmer
Oct 2, 2002
25
US
I've got a table of Business Owners Information (name, city, state...). I've got another table which hold the Offers Business have placed. I want to display a list of all the Business Owner Information AND if the Business has an Offer in the database, I want to display the Offer Name.

The problem is that I dont want to do a Join where I only show Business Owners info if they have an offer in the database. I want to show all the Business owner info AND IF they have an offer, then simply display the text "YES". How do I write the SQL statement to do this (If a Biz has an offer, I insert the idBiz (primary key in Business Owner table, into the offers table)

Thanks for any help
 
Use a LEFT OUTER JOIN
see JOIN Fundamentals faq183-4785

Hope I've been helpful,
Wayne Francis

If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top