New join type ?
Date: 18 Mar 2002 21:08:54 -0800
Message-ID: <a9d4de17.0203182108.41c05d0f_at_posting.google.com>
Hi all
This IS a theory question/suggestion, but please bare with me while I explain the issue.
Am in the thick of some quite complex SQL work (MS SQL 2000). One
issue that keeps coming up is where I have a column which will match a
column in another table under two circumstances :
1. It is null or 0, in which case it should match any value in the
other table
Of course this is easy to do in SQL with
SELECT * FROM table1.col1, table2.col1
2. It is not null or 0, in which case it should match only identical
values in the other table
WHERE (table1.col1 = table2.col1) OR coalesce(table1.col1, 0) = 0
This match type occurs all over my database, usually with several
'normal' columns which form the primary join, then these additional
'wildcard' columns.
Ben McIntyre
Darwin, Australia
benmc.nojamorspam_at_bigfoot.thankyoumam.com
Received on Tue Mar 19 2002 - 06:08:54 CET