gpt4 book ai didi

sql - 无法在子查询中识别 'select'附近的输入

转载 作者:行者123 更新时间:2023-12-02 21:14:04 24 4
gpt4 key购买 nike

SELECT 
(case TRIM(T.tactictype)
WHEN 'Economics' THEN
(select economic_tactic_id from cfext.economic_tactics E where LOWER(E.economic_tactic_name) = LOWER(T.tacticname) )
WHEN 'Cyber' THEN
(select cyber_tactic_id from cfext.cyber_tactics E where LOWER(E.cyber_tactic_name) = LOWER(T.tacticname) )
end) AS tacticid
FROM cfext.banking_crreport_allfiles T
LIMIT 50;

我试图运行上面的查询,下面的错误。
有人可以帮忙吗?

失败:ParseException行4:1无法识别表达式规范中'select''economic_tactic_id''from'附近的输入

最佳答案

尝试使用

SELECT (case TRIM(T.tactictype) WHEN 'Economics' THEN (select E.economic_tactic_id from cfext.economic_tactics E 
where LOWER(E.economic_tactic_name) = LOWER(T.tacticname) )
WHEN 'Cyber' THEN (select E.cyber_tactic_id from cfext.cyber_tactics E where LOWER(E.cyber_tactic_name) = LOWER(T.tacticname) ) end) AS tacticid
FROM cfext.banking_crreport_allfiles T LIMIT 50;

关于sql - 无法在子查询中识别 'select'附近的输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39335412/

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