Doris Manning
mikedorism at verizon.net
Fri Dec 1 14:30:13 CST 2006
SQL has 2... ISNULL() and COALESCE() The first says what to do if the value is null... the second will look through a series of values and stop at the first non-null result. Doris Manning -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, December 01, 2006 3:23 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] join pulls no records Hi John: Have you checked to see if some of the fields, in the index, that you are depending have 'nulls'. In some cases a single null will negate the entire select. Oracle has a NVL() function that resolve this but I am sure MS SQL does also. Try reversing the joins (outer - inner) and see if there are any results. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Friday, December 01, 2006 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] join pulls no records I have two tables. Each has an nvarchar 50 field which contains a string consisting of the first 5 characters of about 5 different fields, which is called in the client's industry a "match code" and is used to find the same name / address record in a different table. I have made the field the PK, so there is an index and it is unique. A join of the two tables pulls no records. I can manually look in the two tables and see visually identical data, i.e. it looks like the match code matches but an inner join does not pull records. Any clue why not? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com