22,210
社区成员
发帖
与我相关
我的任务
分享
declare @str nvarchar(200),@syxh nvarchar(200)
set @str =''
select @str = @str +zdmc +',' from ZY_BRZDQK where syxh=@syxh and zdlb=2 and zdlx=1
select a.hzxm as 姓名,诊断= @str from ZY_BRSYK a (nolock) where a.blh='100'
select a.hzxm as 姓名,诊断=(select max(zdmc) from ZY_BRZDQK where syxh=a.syxh and zdlb=2 and zdlx=1) from ZY_BRSYK a (nolock) where a.blh='100'
select a.hzxm as 姓名,诊断=(select top 1 zdmc from ZY_BRZDQK where syxh=a.syxh and zdlb=2 and zdlx=1) from ZY_BRSYK a (nolock) where a.blh='100'