[BUG] 生成的SQL语句字段不存在
@xuwei-fit2cloud is already working on this.
Since Dec 29, 2025.
Assessment
This issue has not been assessed yet.
Description
SQLBot Version
1.4.0
Run Mode
Is it running in a Docker container or running from source code?
Docker container
Describe the bug
模型:Grok(换其他模型也出现过)
用户问题:新疆的塞浦路斯AAAA产品的提供商是谁?
生成SQL:
SELECT
c.CUSTOMER_NAME AS customer_name,
p.CUST_CURRENT_PROD AS product_name,
comp.COMPETITOR_NAME AS provider_name
FROM
sales.ai_cust_info c
JOIN sales.blade_region r ON c.PROVINCE = r.code
JOIN sales.ai_cust_prod cp ON c.ID = cp.CUST_ID
LEFT JOIN sales.ai_competitor comp ON FIND_IN_SET( comp.ID, cp.PROVIDER ) > 0
WHERE
c.CUSTOMER_NAME LIKE '%塞浦路斯%'
AND r.province_name LIKE '%新疆%'
AND cp.CUST_CURRENT_PROD LIKE '%AAAA%'
LIMIT 1000
查询字段 p.CUST_CURRENT_PROD ,就没有表的别名p,造成解析SQL报错。
之前还出现过表别名存在,查的字段在表里不存在。
小参数的模型还出现过,表别名和表名直接没有空格,反引号变成中文单引号,别名是保留字等问题。
是不是可以有个反思机制,对自己生成的SQL进行检查。
- Dominant language
- JavaScript
- Stars
- 6.8k
- Forks
- 882
- Avg merge
- 4h 41m
- Merged PRs (30d)
- 35
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dataease/SQLBot
-
SQLBot OpenFeedback required
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
[FEATURE] 语言支持泰语 OpenDone feature
-
bug Done
-
bug Done
-
Done feature
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
avniproject/avni-client#2135 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
Difficulty 1/5 Under an hour Newbie friendliness 90/100
matrix-org/matrix.org#3649 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vadimdemedes/ink#1029 ·