Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 如何在oracle中联接8表?_Sql_Oracle11g - Fatal编程技术网

Sql 如何在oracle中联接8表?

Sql 如何在oracle中联接8表?,sql,oracle11g,Sql,Oracle11g,您好,我有将近8个表需要加入并获得完整的结果。请在这方面帮助我。我怀疑我们是否可以用它来代替加入。您可以加入8个表,SQL规范中没有禁止加入的内容,如果一个像样的DBMS仅限于此级别,我会非常惊讶。是的,尽管它无法区分空字符串和空字符串之间的差异,但是很多人都认为Oracle像样:-< /P> 但是,我建议您在这里发布您的模式以及您需要的列,以便我们可以从更高的级别帮助您 即使在企业数据库中,也很少看到像这样复杂的连接。这样的查询也可能存在性能问题。连接这么多表是很有可能的,但可能很难读取。 最

您好,我有将近8个表需要加入并获得完整的结果。请在这方面帮助我。我怀疑我们是否可以用它来代替加入。

您可以加入8个表,SQL规范中没有禁止加入的内容,如果一个像样的DBMS仅限于此级别,我会非常惊讶。是的,尽管它无法区分空字符串和空字符串之间的差异,但是很多人都认为Oracle像样:-< /P> 但是,我建议您在这里发布您的模式以及您需要的列,以便我们可以从更高的级别帮助您


即使在企业数据库中,也很少看到像这样复杂的连接。这样的查询也可能存在性能问题。

连接这么多表是很有可能的,但可能很难读取。 最好为子查询创建多个视图并连接这些视图,或者在主查询中使用子查询并简单地使用它。
SQL当然会变得相当长,但可能更容易阅读。

如果您有8个名为:

a having id and data1 attributes.
b having id and data2 attributes.
c having id and data3 attributes.
d having id and data4 attributes.
e having id and data5 attributes.
f having id and data6 attributes.
g having id and data7 attributes.
h having id and data8 attributes.
然后,如果要显示所有表的数据:

sql>select a.data1,b.data2,c.data3,d.data4,e.data5,f.data6,g.data7,h.data8 from a,b,c,d,e,f,g,h where a.id=b.id and b.id=c.id and c.id=d.id and d.id=e.id and e.id=f.id and f.id=g.id and g.id=h.id;

将近8张桌子?所以要七张桌子吗?还是七张表和一个视图?为什么你怀疑这是可能的?我认为Oracle是体面的,因为它消除了试图在空和空之间做出非自然的区分。哦,@Thilo,我很想在区分已知、空白和未知的必要性上发动一场宗教战争,但我会克制:-主要是因为winkie。