Hope I'm posting in the right section. I have a master table which contains a unique ID for each company. The company ID is used in 7 transactional tables where I need to isolate all instances where we have a company record with no transactional data.
I run a query like the one below for each company and copy the results to Excel where I combine and filter the results as needed. I was wondering if it is possible to rewrite the script to run against all 7 tables at once and use the distinct statement to return only unique values.
select [ID], [Base] from [Company] left outer join [Transact1] on ([Company].[ID] = [Transact1].[Vendor])
where [Transact1].[Vendor] is null