Fork me on GitHub

sqlserver 把 某一列的所有值 变成 in 里面的内容

SELECT  STUFF(( SELECT  ','+'''' +convert(VARCHAR, cDefine3)+'''' from rdrecord08 where dDate>'2021-2-22' and dDate<'2021-2-26' FOR XML PATH('')), 1, 1, '') AS UserName

posted @ 2021-02-26 11:48  HelloLLLLL  阅读(52)  评论(0编辑  收藏  举报