Teradata SQL (Genius Series Book 5) by Tom Coffing & Mike Larkins

Teradata SQL (Genius Series Book 5) by Tom Coffing & Mike Larkins

Author:Tom Coffing & Mike Larkins [Coffing, Tom & Larkins, Mike]
Language: eng
Format: epub
Publisher: Coffing Publishing
Published: 0101-01-01T00:00:00+00:00


How a Correlated Exists matches up

SELECT Customer_Number, Customer_Name

FROM Customer_Table as Top1

WHERE EXISTS

(SELECT * FROM Order_Table as Bot1

Where Top1.Customer_Number = Bot1.Customer_Number) ;

Only customers who placed an order return with the above Correlated EXISTS.

The Correlated NOT Exists

Use NOT EXISTS to find which Customers have NOT placed an Order?

SELECT Customer_Number, Customer_Name

FROM Customer_Table as Top1

WHERE NOT EXISTS

(SELECT * FROM Order_Table as Bot1

Where Top1.Customer_Number = Bot1.Customer_Number) ;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.