Collections:
Query with an Inner Join in Oracle
How To Write a Query with an Inner Join in Oracle?
✍: FYIcenter.com
If you want to query from two tables with an inner join, you can use the INNER JOIN ... ON clause in the FROM clause. The following query returns output with an inner join from two tables: employees and departments. The join condition is that the department ID in the employees table equals to the department ID in the departments table:
SQL> SELECT employees.first_name, employees.last_name, 2 departments.department_name 3 FROM employees INNER JOIN departments 4 ON employees.department_id=departments.department_id; FIRST_NAME LAST_NAME DEPARTMENT_NAME -------------------- -------------------- --------------- Steven King Executive Neena Kochhar Executive Lex De Haan Executive Alexander Hunold IT Bruce Ernst IT David Austin IT Valli Pataballa IT ......
Note that when multiple tables are used in a query, column names need to be prefixed with table names in case the same column name is used in both tables.
⇒ Define and Use Table Alias Names in Oracle
⇐ Ways to Join Two Tables in a Single Query in Oracle
2019-10-27, 1804🔥, 0💬
Popular Posts:
What Is ISAM in MySQL? ISAM (Indexed Sequential Access Method) was developed by IBM to store and ret...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
What Are Bitwise Operations in SQL Server Transact-SQL? Bitwise operations are binary operations per...
How To Install PHP on Windows in MySQL? The best way to download and install PHP on Windows systems ...
What Happens to Your Transactions When ERROR 1205 Occurred in MySQL? If your transaction receives th...