How to join update statement with select?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tksamy
    New Member
    • Aug 2009
    • 1

    How to join update statement with select?

    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
    Recognized Expert Specialist
    • Jun 2007
    • 2878

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

    Happy coding!!

    -- CK

    Comment

    Working...