declare @t table(CountryRegionCode nvarchar(3))
insert into @t(CountryRegionCode) (select CountryRegionCode from person.CountryRegion where Name like "C%")
select * from person.StateProvince where CountryRegionCode
in (select * from @t)
update test set test.name= ta.name
from @mytabe as ta
where test.id=ta.id
str函数用法:
ltrim(str(@role))