ashstampede
Programmer
I want to use a non exists to return rows from two columns then based on my results do more operations. how do i keep the results of this select since there can be many rows returned?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Select column1,column2 from table1
where Not EXISTS
(Select column1,column2
from table2)
Select column1,column2
into #TMP_TABLE
from table1
where Not EXISTS
(Select column1,column2
from table2)
-- do whatever else you need to do using the results stored in #TMP_TABLE
-- drop the table when you're finished with it
DROP TABLE #TMP_TABLE
Select a.column1, b.column2 from table2 a join
(Select column1,column2 from table1
where Not EXISTS
(Select column1,column2
from table2))b
on a.column1 = b.column1
Delete from table3
where column1 in (Select column1,column2 from table1
where Not EXISTS
(Select column1,column2
from table2))