I want to convert this query :
SELECT *
FROM myTable
WHERE dateCreated = (
SELECT MAX(dateCreated)
FROM myTable
)
AND duty IS NULL
AND CompanyPayingId IN
(43081 ,43082 ,43084 ,43085)
to change from in
to Exists
query ( due to performance) :
However I'm having trouble converting the code cause I think I'll have to duplicate the where clause...
How can I convert this code ?