Home Database Mysql Tutorial 立此存照(1).oracle中的联接(join)问题

立此存照(1).oracle中的联接(join)问题

Jun 07, 2016 pm 03:27 PM
join join question

1.oracle中联接(join)分为内联接(inner)和外联接(outer join),而外联接(outer join)又分为 左外联接(left outer join)和右外联接(right outer join)。 2. select * from TEST2; select * from TEST3; (1)笛卡尔乘积(Cartesian Product) select * from TEST2

1.oracle中联接(join)分为内联接(inner)和外联接(outer join),而外联接(outer join)又分为

左外联接(left outer join)和右外联接(right outer join)。

2.

select * from TEST2;
Copy after login

立此存照(1).oracle中的联接(join)问题

select * from TEST3;
Copy after login

立此存照(1).oracle中的联接(join)问题

(1)笛卡尔乘积(Cartesian Product)

  select * from TEST2, TEST3;
Copy after login

结果:

立此存照(1).oracle中的联接(join)问题

(2)内联接(inner join)

select * from 
TEST2 inner join TEST3 on test3.c2 = test2.c2;
Copy after login

结果:

立此存照(1).oracle中的联接(join)问题

(3)外联接(outer join)--作用:由于显示悬浮元祖

  2.1 右外联接(right outer join)

    select * from TEST2 right outer join TEST3 on TEST2.C2 = TEST3.C2;--usage 1
    select * from TEST2, TEST3 where TEST2.C2(+) = TEST3.C2;--usage 2
Copy after login

上述2条语句均表示右外联接

结果:

立此存照(1).oracle中的联接(join)问题

  2.2 左外联接(left right join)

    select * from TEST2 left outer join TEST3 on TEST2.C2 = TEST3.C2;--usage 1
    select * from TEST2, TEST3 where TEST2.C2 =TEST3.C2(+);--usage 2
Copy after login

    上述2条语句均表示左外联接

结果:

立此存照(1).oracle中的联接(join)问题

附录:数据库关于联接的概念

1.悬浮元素(dangling tuple):在一个联接中,若一个元组不能和另一个关系中的任何一个元组配对的话,该元组就成为悬浮元祖。

2.(1)笛卡尔乘积(2)积(3)交叉乘积 均表示同一个意思。

3.自然联接(natural join)

  3.1.先做条件联接

  3.2.对2个相同属性合并





Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

This workbook contains links to one or more external sources that may be unsafe This workbook contains links to one or more external sources that may be unsafe Feb 26, 2024 am 11:07 AM

Does Excel continue to throw This workbook contains links to one or more external sources that may display an unsafe warning message when opening the workbook? Many users have reported that they receive this warning whenever they open an Excel file. Although this warning indicates that there are potentially malicious links in the workbook, it may be triggered even if you have included a trusted external source. This workbook contains links to one or more potentially unsafe external sources if you open Excel. The warning "This workbook contains links to one or more external sources that may be unsafe" appears when you open a file. You can try the following solutions to resolve the issue: Check external links in the workbook and remove untrusted links. . Use the edit link feature

Slack: This link cannot be opened Slack: This link cannot be opened Feb 19, 2024 pm 09:20 PM

We don't want users to get confused when Sack can't open a link. In this article, we will explore ways to solve this problem. If you encounter a similar situation, check out the solutions provided in this article to quickly resolve the issue. Why isn't my Slack working? If Slack isn't running properly, there are some common factors you may want to check. First check the internet connection as the application requires a stable network. Next, check to see if cache and cookies are corrupted, then check the status of the Slack server to clear any firewall or antivirus programs that may be interfering. Users can also try resetting the app or doing a clean installation. Fix We can't open this link in Slack error If you can't open this link in Slack

Solve the 'error: redefinition of class 'ClassName'' problem that appears in C++ code Solve the 'error: redefinition of class 'ClassName'' problem that appears in C++ code Aug 25, 2023 pm 06:01 PM

Solve the "error:redefinitionofclass'ClassName'" problem in C++ code. In C++ programming, we often encounter various compilation errors. One of the common errors is "error:redefinitionofclass 'ClassName'" (redefinition error of class 'ClassName'). This error usually occurs when the same class is defined multiple times. This article will

How to solve the problem of slow Mysql connection in Docker How to solve the problem of slow Mysql connection in Docker Feb 19, 2024 pm 03:09 PM

After using Docker to deploy MySQL, the connection speed is slow. Through online searches, I found that the problem may be caused by the lack of modules such as DNS resolution during the minimum container installation. Therefore, there will be a problem of super slow connection when connecting. We directly add this sentence skip-name-resolve and directly modify the docker-compose.yml configuration. The configuration is as follows version: "3" services: mysql: image: mysql: latestcontainer_name: mysql_composerestart: alwaysports:-3306:3306command:--default-a

Outlook insists on trying to connect [Fix] Outlook insists on trying to connect [Fix] Mar 13, 2024 am 09:22 AM

This article will explore the steps you can take to resolve situations where Outlook is stuck while trying to connect. No matter what version of Microsoft Office, including Microsoft 365, you may encounter this problem. This issue causes the Outlook desktop application to be unable to receive emails properly, so it becomes crucial to resolve this issue. Fix Outlook Hangs on Trying to Connect If Outlook is having trouble connecting and you find that you're not receiving new mail on the desktop app, the following suggestions may be able to help resolve the issue. Before trying these methods, check to see if your internet connection is working properly. Try restarting your router sometimes

How to solve the problem that jQuery cannot obtain the form element value How to solve the problem that jQuery cannot obtain the form element value Feb 19, 2024 pm 02:01 PM

To solve the problem that jQuery.val() cannot be used, specific code examples are required. For front-end developers, using jQuery is one of the common operations. Among them, using the .val() method to get or set the value of a form element is a very common operation. However, in some specific cases, the problem of not being able to use the .val() method may arise. This article will introduce some common situations and solutions, and provide specific code examples. Problem Description When using jQuery to develop front-end pages, sometimes you will encounter

Clustering effect evaluation problem in clustering algorithm Clustering effect evaluation problem in clustering algorithm Oct 10, 2023 pm 01:12 PM

The clustering effect evaluation problem in the clustering algorithm requires specific code examples. Clustering is an unsupervised learning method that groups similar samples into one category by clustering data. In clustering algorithms, how to evaluate the effect of clustering is an important issue. This article will introduce several commonly used clustering effect evaluation indicators and give corresponding code examples. 1. Clustering effect evaluation index Silhouette Coefficient Silhouette coefficient evaluates the clustering effect by calculating the closeness of the sample and the degree of separation from other clusters.

Teach you how to diagnose common iPhone problems Teach you how to diagnose common iPhone problems Dec 03, 2023 am 08:15 AM

Known for its powerful performance and versatile features, the iPhone is not immune to the occasional hiccup or technical difficulty, a common trait among complex electronic devices. Experiencing iPhone problems can be frustrating, but usually no alarm is needed. In this comprehensive guide, we aim to demystify some of the most commonly encountered challenges associated with iPhone usage. Our step-by-step approach is designed to help you resolve these common issues, providing practical solutions and troubleshooting tips to get your equipment back in peak working order. Whether you're facing a glitch or a more complex problem, this article can help you resolve them effectively. General Troubleshooting Tips Before delving into specific troubleshooting steps, here are some helpful

See all articles