Hi everybody,
The following query is very costly in terms of IO:
SELECT distinct m.memberID, [mem number] from members m left join discounts d on m.memberID = d.[id]
I'd like to avoid using distinct. So, I'm thinking of using a subquery with where exists. So is there a way of rewriting the above query with WHERE EXISTS to make it less costly in terms of IO.
Any help is greatly appreciated.
Thank you!
The following query is very costly in terms of IO:
SELECT distinct m.memberID, [mem number] from members m left join discounts d on m.memberID = d.[id]
I'd like to avoid using distinct. So, I'm thinking of using a subquery with where exists. So is there a way of rewriting the above query with WHERE EXISTS to make it less costly in terms of IO.
Any help is greatly appreciated.
Thank you!