gpt4 book ai didi

SQL语法困惑(Natural Join)

转载 作者:行者123 更新时间:2023-11-29 13:58:04 27 4
gpt4 key购买 nike

下面是代码

postgres=# SELECT title,name,borrower.address WHERE library_branch NATURAL JOIN
book NATURAL JOIN book_loans NATURAL JOIN borrow WHERE library_branch.branchname
='Sharpstown' AND dateOut='12/10/2014';
ERROR: syntax error at or near "NATURAL"
LINE 1: ... title,name,borrower.address WHERE library_branch NATURAL JO...
^
postgres=#

不确定为什么会出现错误。我以为我正确地进行了自然连接。有什么建议吗?

最佳答案

你有一个 where 关键字,from 应该去哪里:

SELECT       title, name, borrower.address 
FROM library_branch -- There's a WHERE here in the OP
NATURAL JOIN book
NATURAL JOIN book_loans
NATURAL JOIN borrow
WHERE library_branch.branchname = 'Sharpstown' AND
dateOut = '12/10/2014';

关于SQL语法困惑(Natural Join),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27417474/

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