标签: sql
我们如何在sql CTE中实现动态查询?
答案 0 :(得分:0)
使用CTE实现动态查询
Declare @query Varchar(100) Set @query = 'Select * From TableName' Declare @Result Varchar(200) Set @Result = ';With T As (' + @query + ') Select * From T' Exec(@Result)