Home > Database > Oracle > body text

What does (+) mean in oracle

下次还敢
Release: 2024-05-08 18:57:16
Original
1029 people have browsed it

The ( ) symbol in Oracle represents the outer join symbol, which is used to join tables and return a result set containing all participating table rows, allowing you to retrieve records in the foreign key table even if there are no matching records in the primary key table . There are three types of outer joins: left outer join, right outer join and full outer join.

What does (+) mean in oracle

The meaning of ( ) in Oracle

In Oracle database, the ( ) symbol is called an outer connection symbol . It is used to join two or more tables and returns a result set containing rows from all participating tables.

Role

( ) notation allows you to retrieve records from a foreign key table even if a matching record does not exist in the corresponding primary key table. In other words, it enables you to return all rows from one table even if they have no match in another table.

Grammar

The syntax for outer joins is as follows:

<code>SELECT *
FROM table1
(+)
JOIN table2
ON table1.id = table2.id</code>
Copy after login

Type

There are three types of outer joins Join:

  • Left Outer Join: Returns all rows from the left table, even if there is no match in the right table.
  • Right outer join: Returns all rows from the right table, even if there is no match in the left table.
  • Full outer join: Returns all rows from both tables, regardless of whether there is a match.

Example

Suppose we have two tables:

<code>employees (id, name)
departments (id, department_name)</code>
Copy after login

The following query selects all from these two tables using a left outer join Row:

<code>SELECT *
FROM employees
(+)
JOIN departments
ON employees.department_id = departments.id</code>
Copy after login

This query will return the details of all employees even if they are not assigned to any department.

The above is the detailed content of What does (+) mean in oracle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!