gpt4 book ai didi

c# - 您的 SQL 语法有错误

转载 作者:行者123 更新时间:2023-11-29 07:28:33 25 4
gpt4 key购买 nike

我做错了什么? C# 翻译有问题吗?

string commandText = 
@"SELECT sc.sc_n,
sc.provider_n,
sc.sc_external_id,
sc.sc_external_name
FROM t_supplier_codification sc
WHERE sc.product_articul IS NULL
AND (sc.sc_external_name != "")
AND sc_count >= 1
AND provider_n=19
AND LENGTH(sc.sc_external_name)>=10
AND sc_external_name NOT LIKE '%лента%'
AND sc_external_name NOT LIKE '%камера%'
AND sc_external_name NOT LIKE '%Replica%'
AND sc_external_name NOT LIKE '%ET%'
AND sc_external_name LIKE ''
ORDER BY sc_external_name";

您的 SQL 语法有错误:

check the manual that corresponds to your MySQL server version for the right syntax to use near '") AND sc_count >= 1 AND provider_n=19 AND LENGTH

最佳答案

您需要使用单引号而不是双引号:

(sc.sc_external_name!='')

作为双引号终止您的字符串。此外,单引号通常用于 SQL 中的字符串文字,双引号用于列名(和其他对象)。

关于c# - 您的 SQL 语法有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33611226/

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