老师
我的表结构如下:
表名 a
dw (列名) 备注列
34,56
78,88
SQL 语句 se lec t stuff((s el ec t ',' +CAST(dw as varchar) from {a} Order by _Identify For xml path('')),1,1,'')) as dw1 from {a}
得到结果: 34,56,78,88
这个结果正好是我想要的 另外一个表b 的_Identify的值 我想要得到 s ele ct 价格 from {b} where _Identify in (34,56,78,88)
要怎么才能用上第一个语句的结果,来得到 s el e ct 价格 from {b} where _Identify in (34,56,78,88) ?