标签:group by creat sql table ast cas lse 简单的 interface
Declare @Sql Varchar(500)
Create Table #t(
PatientID Varchar(20)
)
Set @Sql = ‘‘
Select @Sql = @Sql + ‘ Alter Table #t Add Class_‘ + Cast(Item As Varchar(20)) + ‘ Varchar(20) Default ‘‘0‘‘‘
From YbInterface.dbo.B1
group by Item
Print @Sql
Exec (@sql)
select * from #t
drop table #t
标签:group by creat sql table ast cas lse 简单的 interface
原文地址:https://www.cnblogs.com/meitai/p/11369987.html