使用PostgreSQL的关系
在这里,我附加了PostgreSQL中显示的错误。这里的book_detail是一个表,binding_detail是另一个表。主要关键是book_id,外键是binding_id。
选择b.book_title,e.binding_id, 从book_details b,binding_details e 其中b.binding_id = e.binding_id;
错误:“从”或附近的语法错误 第2行:book_details b,binding_details e ^ SQL状态:42601 角色:37
Here i have attached the error displayed in postgreSQL. Here the Book_Detail is one table and Binding_Detail is another table. Primary Key is Book_Id and Foreign Key is Binding_Id.
SELECT b.Book_Title, e.Binding_Id,
FROM Book_Details b, Binding_Details e
WHERE b.Binding_Id = e.Binding_Id;
ERROR: syntax error at or near "FROM"
LINE 2: FROM Book_Details b, Binding_Details e
^
SQL state: 42601
Character: 37
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的情况下,问题是从发出前的逗号。您必须删除此。顺便说一句,我强烈建议不要使用此语法“从表A,表B”,而是使用加入。
The problem in your case is the comma before the FROM. You must remove this. By the way I highly recommend to do not use this syntax "FROM table a, table B", but to use JOIN instead.
在
e.binding_id
之后删除逗号您需要
You need to remove the comma after
e.Binding_Id
It would be better to use a JOIN