Sometimes you need to see the items in a SQL table that does not match when left joining two or more tables together.
Here’s an example
Say we have a customer table and an invoicing header table and you would like to see which customers are created but has never bought anything via your ERP.
Customer Setup Table
Table name: [ARCUS]
Invoice Header Table.
Table Name: [OEINVH]
The following query will return all customers who has not been used in the accounting system.
left join OEINVH on ARCUS.IDCUST=OEINVH.CUSTOMER
where OEINVH.CUSTOMER is null
164 total views, 1 views today