Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: RE: sql_language digest: August 08, 2001


Message #1 by "Rick Dobson" <rddcab@i...> on Thu, 9 Aug 2001 07:38:54 -0400
Hi Richard,

Use a left outer join to force all the records from the left table into your
result set even if there is no match from a record in the right table.
Professional SQL Server Development with Access 2000 has this example, which
you may find useful

SELECT Categories.CategoryName, Categories.Description, Products.ProductName
FROM Categories LEFT OUTER JOIN Products ON Categories.CategoryID 
Products.CategoryID

I hope this helps.

Rick Dobson
www.programmingmsaccess.com
www.cabinc.net
rickd@c... <mailto:rickd@c...>



Subject: 2 tables join with null values
From: Bukovansky@a...
Date: Wed, 8 Aug 2001 14:40:16 +0200
X-Message-Number: 1

Hi all,

I've got a problem with joining two tables.
First table has records about goods and second the types
of dalivery. This tables are in my SQL statment joined
this way:

SELECT * FROM goods G
	INNER JOIN delivery_types DT
	ON DT.code_delivery_type = G.code_delivery_type.

code_... is varchar(30) variable.

Trouble is, if the code at both tables is NULL value.
There aren't
joined. This record from goods is skipped.
How to force SQL 7 to join the rows with NULL values too?
Table delivery_tables is table with no records added,
deleted etc. Just only one record has code column
with NULL value.

Thanx for help.

Regards,

Richard Bukovansky



  Return to Index