Re: Question about joining tables
- From: "Knowledgy" <atlanta business intelligence consultants>
- Date: Thu, 28 Feb 2008 18:50:13 -0500
SELECT *
FROM property p LEFT OUTER JOIN property_image pi
ON p.property_id = pi.property_id
Use the newer ansi join syntax. DBMS systems are deprecating
the older style join you're using
--
Sincerely,
John K
Knowledgy Consulting
http://knowledgy.org/
Atlanta's Business Intelligence and Data Warehouse Experts
<bissatch@xxxxxxxxxxx> wrote in message
news:853f063c-3ba8-4455-a7b4-814b13623005@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
Say I have two tables, one called property which stores details of
properties, and anothe called property_image that stores a single
image for a property. So either property may have one image or no
image. I know how to do the following join:
SELECT * FROM property, property_image WHERE property.property_id =
property_image.property_id
Works fine if I need only returned the properties that tie up with
images but the properties that dont tie up I dont get returned in my
result. Is it possible to create an SQL joining statement where all
properties would be returned including the ones that dont have an
property image? Those that dont just wouldnt have any values in the
property_image.* columns. Traditionally I would do a query on the
property table then for each property do a single SELECT lookup on the
property_image table .. im sure for performance if i could reduce this
to one query i would see an improvement.
Thanks
Burnsy
.
- Follow-Ups:
- Re: Question about joining tables
- From: Roy Hann
- Re: Question about joining tables
- References:
- Question about joining tables
- From: bissatch
- Question about joining tables
- Prev by Date: Re: header part of the value?
- Next by Date: Re: header part of the value?
- Previous by thread: Re: Question about joining tables
- Next by thread: Re: Question about joining tables
- Index(es):
Relevant Pages
|