I have a simple SQL query:
SELECT
columnA, columnB, columnC...
FROM
(SELECT
columnA, columnB, columnC...
FROM
SomeTable) Table1
WHERE NOT EXISTS
(SELECT
columnA
FROM
SomeOtherTable st
WHERE
st.columnB = Table1.columnB)
Can anyone give me a suggestion how to rewrite this query for better performance? I mean to include the WHERE NOT EXISTS clause in Table1.
You can use this:
For the performance it is important to have indexes on
columnBon both tables.