Use an OUTER JOIN.

SELECT *
FROM table01 one
INNER JOIN table02 two
        ON one.id = two.fk_id

This will only return rows from table01 that also have matching values in
table02.

SELECT *
FROM table01 one
LEFT JOIN table02 two
        ON one.id = two.fk_id

This, however, will return ALL rows from table01 and any rows that have
matching values in table02.


<!----------------//------
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: Mark Fuqua [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 29, 2005 7:45 AM
To: CF-Talk
Subject: query question


Morning,

When I use joins with a select statement, and one of the columns in the
query is blank, that record is not part of the record set.  I would like to
include the records with missing columns and have those columns just be
blank.  Is that a possibility?

Thanks,

Mark





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219604
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to