Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
JOIN question
Message
 
 
To
15/05/2002 13:24:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00657023
Message ID:
00657025
Views:
32
This message has been marked as the solution to the initial question of the thread.
You cannot compare value to the Null because the result will be always Null. Use Isnull() function to check if value is null.
select rs.acctno, rs.clientcode, r.trans_no ;
  from Rssched rs ;
  left outer join rsmast r ;
  on rs.trans_no = r.trans_no ;
  where ISNULL(r.trans_no) ;
  into table RSCConfRpt 
Or use subquery
select rs.acctno, rs.clientcode ;
  from Rssched rs ;
  Where rs.trans_no NOT IN ( Select r.trans_no From rsmast r) ;
  into table RSCConfRpt 
>Hello,
>
>I am trying to find all non-matching records between two tables. When I merely JOIN the tables like this ...
>
>select rs.acctno, rs.clientcode, r.trans_no ;
>from Rssched rs ;
>left outer join rsmast r ;
> on rs.trans_no = r.trans_no ;
>into table RSCConfRpt
>
>I get many NULL records in my r.trans_no field as expected.
>However, when add a where clause to limit the result set to just NULL records, like this .....
>
>select rs.acctno, rs.clientcode, r.trans_no ;
>from Rssched rs ;
>left outer join rsmast r ;
> on rs.trans_no = r.trans_no ;
>where r.trans_no = .NULL. ;
>into table RSCConfRpt
>
>I get no records whatsoever ! trans_no in both tables have indexes, and both will accept NULL values.
>
>Thank in advance, Ken
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform