Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use LEFT JOIN
Message
 
To
16/03/2002 13:13:11
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00633770
Message ID:
00633829
Views:
15
Aritra,

My other response showed you how to use the ANSI JOIN syntax to get the left outer join, if you want to do it with the WHERE clause you can do it this way.
SET DELETED ON
SELECT emp.emp_id, emp.emp_name, emp.emp_address, sec.emp_section ;
  FROM empl emp,  empsec sec ;
 WHERE emp.emp_id == sec.emp_id ;
 UNION ALL ;
SELECT emp.emp_id, emp.emp_name, emp.emp_address, SPACE(XX) ;
  FROM Empl emp ;
 WHERE emp.empID NOT IN(SELECT EmpID FROM Empsec) ;
INTO CURSOR temp
SPACE(XX) is a placeholder for the sec.e,p_section field, make the XX rthe number of spaces for the length of the emp_section field.
Previous
Reply
Map
View

Click here to load this message in the networking platform