gpt4 book ai didi

sql-server - 如何将字符串与位 (documentTitle+Archive) SQL server 2005 连接起来

转载 作者:行者123 更新时间:2023-12-03 12:35:06 25 4
gpt4 key购买 nike

当我尝试连接时出现以下错误
操作数类型冲突:文本与位不兼容
数据类型的无效运算符:运算符等于添加,类型等于位

SELECT
F.SubmissionId, F.FormId,
F.DocumentTitle + F.Archive AS DocumentTitle,
F.Keywords, F.PublishDate, F.PostedDate, F.ExpiredDate,
F.IsFlag, F.IsAdminOnly, F.IsCompleted, F.IsPublished,
F.CreatedDate, F.AllowComments,
CASE WHEN F.Archive = 1 THEN 'Yes' ELSE 'No' END AS Archive,
I.ItemId, I.SubmissionId AS Expr1, I.ParamId, I.ParamValue
FROM
dbo.app_FormSubmission AS F
INNER JOIN dbo.app_FormSubmissionItems AS I ON
F.SubmissionId = I.SubmissionId

最佳答案

你需要转换,运行这个看看我的意思

declare @i bit
select @i = 1

select 'abc' + convert(varchar(1),@i) -- fine
select 'abc' + @i -- will fail

关于sql-server - 如何将字符串与位 (documentTitle+Archive) SQL server 2005 连接起来,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/492383/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com