>>;with allCombinations as (select I.*, B.* from Items I, Branches B) >> >>select AC.* from allCombinations AC where not exist (select 1 from BranchItems BI where BI.ItemId = AC.ItemID and BI.BranchId = AC.BranchID) >>The exists part in your query should be simplified (e.g. just use BrachItems as I did). Other than that I used CTE for clarification and maintenance point only - no need to use CTE and you can use it directly.