Hello,
Is there a way to use the if exists select statement result ?
for example:
in my example above I had to select the same data twice, one for checking if the data exists and then select it again to use it..Code:IF EXISTS (SELECT col1 FROM table1 where id = 1) BEGIN SELECT col1 FROM table1 where id = 1 END ELSE BEGIN -- select from other table END
so is there a way to use the data i've already selected in the "IF EXISTS" clause ?
thanks and best regards.




If you Like it 
Reply With Quote