You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
按照示例提问:“请帮我查询货物销售量最大的货物名称”,显示:“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
The text was updated successfully, but these errors were encountered: