gpt4 book ai didi

SQL 查询 - 关键字 'LIKE' 附近的语法不正确

转载 作者:行者123 更新时间:2023-12-02 15:32:43 24 4
gpt4 key购买 nike

下面的查询在“CASE WHEN NOT LIKE”(消息 156,级别 15,状态 1,第 14 行关键字“LIKE”附近的语法不正确)

SELECT     
TimeStamp,
TimeStampNS,
ISNULL(TagName, 'NoTag') AS TagName,
Message,
ConditionName,
ISNULL(TagName, 'NoTag') + '.' + ConditionName AS Source,
CENTUMMsgId,
StationName,
ISNULL(AlarmLevel,5) AS AlarmLevel,
ActiveTime,
ActorID,
ISNULL(AlarmOff,0) AS AlarmOff,
CASE WHEN NOT LIKE '% ACK%' AND CENTUMMsgId IN (4353, 4355, 4609) THEN 1 ELSE 0 END AS RaiseAll,
CASE WHEN LIKE '% ACK%' THEN 1 ELSE 0 END AS Acknowledge,
CASE WHEN CENTUMMsgId IN (4354, 4356, 4358, 4614) AND Message NOT LIKE '% ACK%' THEN 1 ELSE 0 END AS Normal,
PlantHierarchy,
'EXAOPC' AS SourceType
FROM QHistorianData.dbo.vEXAOPCCSProcessAlarm

你们知道发生了什么事吗...我想我的一切都是正确的。

提前感谢您的帮助。

最佳答案

我想你错过了这里的属性名称:

CASE WHEN <ATTRIBUTE-NAME> NOT LIKE '% ACK%' AND CENTUMMsgId IN (4353, 4355, 4609) THEN 1   ELSE 0 END AS RaiseAll, 
CASE WHEN <ATTRIBUTE-NAME> LIKE '% ACK%' THEN 1 ELSE 0 END AS Acknowledge,
CASE WHEN CENTUMMsgId ...

关于SQL 查询 - 关键字 'LIKE' 附近的语法不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22756809/

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