Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Join six tables with single SELECT statement
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01316996
Message ID:
01317201
Views:
8
You'll get records from 'visual' table regardless if there're related records in other tables.You may want to wrap fields from other tables in NVL() to avoid nulls. You don't have to change WHERE clause because it references only fields from the 'visual' table.
select v.custid, v.upsino, v.datinp, v.optemp, v.pktemp, ;
	  l.dielectric, l.neut_no, l.ift, l.h20, ;
	  d.hydrogen, d.methane, d.ethylene, ;
	  i.aluminum, i.copper, i.iron, ;
	  f.hydroxymth, f.furfuryl, f.furaldehyd ;
	from visual v ;
	LEFT JOIN liquid l on l.custid = v.custid and l.upsino = v.upsino and v.datinp = l.puldat ;
	LEFT JOIN dga d on d.custid = l.custid and d.upsino = l.upsino and d.puldat = l.puldat ;
	LEFT JOIN icp i on i.custid = d.custid and i.upsino = d.upsino and i.puldat = d.puldat ;
	LEFT JOIN furanppm f on f.custid = d.custid and f.upsino = d.upsino and f.puldat = d.puldat ;
	WHERE v.custid = "SC100234" and v.upsino = "0000004" ;
	order by v.upsino, v.datinp
>
>I thought I'm using FULL JOIN because I thought I had in order to retrieve all records from both tables if they meet the filter criteria.
>
>Both you and Tamar tell me I have to put what I have in my WHERE clause into the JOIN condition. How do I do that? Do I put the filter criteria in each and every join?
>
>Can you copy and paste my earlier code here and tell me what I'm doing wrong?
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform