SQL Server 2005 Setting a variable to the result of a select query

前端 未结 6 985
面向向阳花
面向向阳花 2021-02-05 00:31

How do I set a variable to the result of select query without using a stored procedure?


I want to do something like: OOdate DATETIME

SET OOdate =          


        
6条回答
  •  独厮守ぢ
    2021-02-05 00:51

    What do you mean exactly? Do you want to reuse the result of your query for an other query?

    In that case, why don't you combine both queries, by making the second query search inside the results of the first one (SELECT xxx in (SELECT yyy...)

提交回复
热议问题