简体   繁体   English

Orientdb SQL,从多个表中选择

[英]Orientdb sql , select from multiple tables

dont run "select from multiple tables" commands in orientdb 3.0 (centos) 不要在orientdb 3.0(centos)中运行“从多个表中选择”命令

i tested like this following commands 我测试了以下命令

SELECT *
FROM Employee A, City B
WHERE A.city = B.id

Error Codes ; 错误代码; "Error parsing query: ^ Encountered " "SELECT "" at line 1, column 1. Was expecting one of: ... ... ";" ... DB name=" “错误分析查询:^在第1行第1列遇到““ SELECT”“,期望以下之一:... ...”;“ ... DB name =”

The most important difference between OrientDB and a Relational Database is that relationships are represented by LINKS instead of JOINs. OrientDB和关系数据库之间最重要的区别是关系由LINK而不是JOIN表示。

For this reason, the classic JOIN syntax is not supported. 因此,不支持经典的JOIN语法。 OrientDB uses the "dot (.) notation" to navigate LINKS. OrientDB使用“点(。)表示法”导航LINKS。 Example 1 : In SQL you might create a join such as: 示例1:在SQL中,您可以创建一个联接,例如:

SELECT *
FROM Employee A, City B
WHERE A.city = B.id
AND B.name = 'Rome'

In OrientDB an equivalent operation would be: 在OrientDB中,等效操作为:

SELECT * FROM Employee WHERE city.name = 'Rome'

For more information: https://orientdb.com/docs/2.2.x/SQL.html#joins 有关更多信息: https : //orientdb.com/docs/2.2.x/SQL.html#joins

Hope it helps 希望能帮助到你

Regards 问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM