我正在尝试运行此查询,但myfield不包含完整的电子邮件地址,姓氏,电话和电子邮件促销值?看起来myField的长度有限制吗?
sql语句:
use adventureworks
go
select si.CustomerID,
'myField' =
CASE
When (Select Top 1 FirstName+ ' ' + MiddleName + ' '+ Phone + ' ' + EmailAddress +' '+ LastName + ' ' + Phone + ' ' + cast(EmailPromotion as varchar) From Person.Contact pc Where si.ContactID = pc.contactid ) is not null Then
Cast((Select Top 1 FirstName+ ' ' + MiddleName + ' ' + Phone + ' ' +EmailAddress +' '+ LastName + ' ' + Phone + ' ' + cast(EmailPromotion as varchar) From Person.Contact pc Where si.ContactID = pc.contactid ) As varchar)
Else ''
END
from Sales.Individual si
where si.CustomerID=11000
答案 0 :(得分:0)