Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql语句执行失败 #20

Open
pkuwudi opened this issue Oct 17, 2023 · 2 comments
Open

sql语句执行失败 #20

pkuwudi opened this issue Oct 17, 2023 · 2 comments

Comments

@pkuwudi
Copy link

pkuwudi commented Oct 17, 2023

按照示例提问:“请帮我查询货物销售量最大的货物名称”,显示:“sql语句执行失败 near "sql": syntax error”
看起来是生成的sql语句不正确,查询了一下yaml里面没有的字段,请问这种问题如何解决。

详情见下面:

请帮我查询货物销售量最大的货物名称

根据你提供的表格信息,我假设你想要查询的是2019年销售量最大的货物名称。你可以使用以下SQL语句来查询这个信息:

SELECT c.cargo_name
FROM cargo c
JOIN cargo_info i ON c.cargo_id = i.cargo_id
JOIN source_cargo s ON i.cargo_id = s.cargo_id
JOIN storage_warehouse w ON s.cargo_id = w.cargo_id
JOIN sales_department d ON w.cargo_id = d.cargo_id
JOIN sales_person s_per ON d.sales_person_id = s_per.sales_person_id
JOIN sales_person s_市场 ON s_per.sales_person_id = s_市场.sales_person_id
JOIN cargo_category c_cat ON c.cargo_category = c_cat.cargo_category
JOIN source_cargo s_src ON c_cat.source_cargo_id = s_src.cargo_id
JOIN storage_warehouse s_ware on s_src.storage_warehouse_id = s_ware.storage_warehouse_id
JOIN sales_volume s_volume ON s_ware.cargo_id = s_volume.cargo_id
JOIN month_on_month_growth_rate m_g on s_volume.month_on_month_growth_rate = m_g.month_on_month_growth_rate
JOIN loss_rate l_r on m_g.

sql语句执行失败

near "sql": syntax error

@pkuwudi
Copy link
Author

pkuwudi commented Oct 30, 2023

@yysirs 如何让模型生成的sql语句更可控,不产生yaml文件里没有的字段

@yysirs
Copy link
Member

yysirs commented Nov 4, 2023

@yysirs 如何让模型生成的sql语句更可控,不产生yaml文件里没有的字段

  1. 根据llm设计更仔细的prompt
  2. 对llm进行微调

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants