Connecting Tech Pros Worldwide Help | Site Map

How to join update statement with select?

Newbie
 
Join Date: Aug 2009
Posts: 1
#1: Aug 21 '09
Dear Sir/Madam

I want to use the output of update statement in the select statement. But I couldn't.

My query is

select Table1.*, x.seqno
from Table1
cross join
(UPDATE z_addin_counter
SET seqno = seqno + 1
OUTPUT INSERTED.seqno ) x


Is there any possibility to join update with select?

With Thanks
Ksamy.
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#2: Aug 22 '09

re: How to join update statement with select?


You can direct the resultset from OUTPUT clause into a variable or temp table.

Happy coding!!

-- CK
Reply