Hi everyone
I'm trying to understand the difference between EXISTS and WHERE...IN in SQL. Some articles that I've read suggest that WHERE...IN subqueries can be re-written as WHERE EXISTS.
I have the following query:
SELECT * FROM Customer, Appointment WHERE Appointment.CustomerCode = Customer.CustomerCode AND Appointment.ServerCode IN (SELECT ServerCode FROM Appointment WHERE CustomerCode = '102');
How would I rewrite this as a query using EXISTS instead of WHERE...IN?
Thanks for any help.