gpt4 book ai didi

sql - 来自多个表的内部连接 ​​sqlite

转载 作者:行者123 更新时间:2023-12-03 17:38:32 26 4
gpt4 key购买 nike

按照代码给我一个模棱两可的列 DRIVER.driv_id 错误,有什么帮助吗?

SELECT DRIVER.driv_id, DRIVER.firstName, DRIVER.surName, DRIVER.nationality,   TEAMSTANDING.teamName, RESULTS.points
FROM TEAMSTANDING INNER JOIN DRIVER ON TEAMSTANDING.driv_id=DRIVER.driv_id,
RESULTS INNER JOIN DRIVER ON RESULTS.driv_id=DRIVER.drv_id
WHERE TEAMSTANDING.comp_id=2
GROUP BY DRIVER.driv_id;

最佳答案

您必须尝试多次添加驱动程序表,以便创建此表

SELECT 
DRIVER.driv_id, DRIVER.firstName, DRIVER.surName, DRIVER.nationality, TEAMSTANDING.teamName, RESULTS.points
FROM
TEAMSTANDING
INNER JOIN
DRIVER
ON
TEAMSTANDING.driv_id=DRIVER.driv_id
INNER JOIN
RESULTS
ON
RESULTS.driv_id=DRIVER.drv_id
WHERE
TEAMSTANDING.comp_id=2
GROUP BY
DRIVER.driv_id;

关于sql - 来自多个表的内部连接 ​​sqlite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16223979/

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