today:
236
yesterday:
219
Total:
1,004,152

INNER JOIN

admin 2023.05.19 22:09 Views : 39

What is Inner Join in Oracle?

The INNER join is such a join when equijoins and nonequijoins are performed, rows from the source and target tables are matched using a join condition formulated with equality and inequality operators, respectively. These are referred to as inner joins.

Syntax:

SELECT table1.column, table2.column
FROM table1
INNER JOIN table2
ON table1.column_name = table2.column_name;

Pictorial presentation of Syntax:

pictorial presentation of oracle inner join syntax

Pictorial presentation of Inner Join:

pictorial presentation of oracle inner join

Example:

The following SQL statement will return department no, department name and the city for a the same location no.

Sample table: locations

 

Sample table: departments

 

SELECT a.department_id, a.department_name, b.city
FROM departments a
INNER JOIN locations b
ON a.location_id = b.location_id;

Sample Output:

DEPARTMENT_ID DEPARTMENT_NAME                CITY
------------- ------------------------------ ---------------------
           60 IT                             Southlake
           50 Shipping                       South San Francisco
           10 Administration                 Seattle
           30 Purchasing                     Seattle
           90 Executive                      Seattle
          100 Finance                        Seattle
          110 Accounting                     Seattle
          120 Treasury                       Seattle
          130 Corporate Tax                  Seattle
          140 Control And Credit             Seattle
          150 Shareholder Services           Seattle
          160 Benefits                       Seattle
          170 Manufacturing                  Seattle
          180 Construction                   Seattle
          190 Contracting                    Seattle
          200 Operations                     Seattle
          210 IT Support                     Seattle
          220 NOC                            Seattle
          230 IT Helpdesk                    Seattle
          240 Government Sales               Seattle
          250 Retail Sales                   Seattle
          260 Recruiting                     Seattle
          270 Payroll                        Seattle
           20 Marketing                      Toronto
           40 Human Resources                London
           80 Sales                          Oxford
           70 Public Relations               Munich

27 rows selected.

INNER JOINS: SQL and other Relational Databases

Previous: JOINS with USING Clause
Next: LEFT OUTER JOIN

No. Subject Author Date Views
26 APEX ADMIN PASSWORD 바꾸기 admin 2016.05.02 116
25 wwv_flow_files admin 2016.05.01 155
24 EXPORT & IMPORT admin 2016.05.01 175
23 Outer Join with Oracle SQL admin 2016.04.29 148
22 Report by Order / Product / Order and Product / By Order & Non Order admin 2016.04.29 220
21 Delimiter admin 2016.04.29 141
20 SQL SELECT DISTINCT Statement admin 2016.04.29 161
19 TAP ( Main & Sub ) / Button 의 Switch admin 2016.04.28 166
18 COUNT admin 2016.04.28 146
17 CREATING A TABLE / SEQUENCE / TRIGGER admin 2016.04.28 172
16 CREATE (INSERT) PROCESS admin 2016.04.28 151
15 DELETE PROCESS admin 2016.04.28 158
14 Global & Custom Serach file admin 2016.04.28 128
13 INSERT PROCESS admin 2016.04.28 160
12 JAVA for delete admin 2016.04.28 162
11 LIST OF VALUE (DYNAMIC) admin 2016.04.28 127
10 MAX admin 2016.04.28 155
9 Name Show admin 2016.04.28 203
8 PHONE NUMBER admin 2016.04.28 153
7 UPDATE PROCESS admin 2016.04.28 167