sql拼接字符串和转换类型

select top 10 a.ID as a_ID,a.Name as a_Name,c.*
from (select * from DC_Trees where Pid=187 or ID=187 ) a
inner join DC_LibResourceTree b on (','+CAST(a.ID as nvarchar(50))+',')=b.treeval
left join TbLibResource c on c.ID=b.tbpid
where c.audit=0
order by c.AddDateTime desc

posted @ 2015-11-24 09:42  jamess  阅读(346)  评论(0编辑  收藏  举报