ORACLE
ORACLE JOINS
INNER JOIN
OUTER JOIN
EQUI JOIN
SELF JOIN
CROSS JOIN
ANTI JOIN
SEMI JOIN
ORACLE TUTORIAL
Oracle Introduction
What Is Oracle
Create Tables
What Is Oracle
ORACLE TABLES
Create Tables
Create Table As
Alter Table
Drop Table
Global Temorary Tables
Local Temorary Tables
ORACLE VIEWS
Create View
ORACLE QUERIES
SELECT
INSERT
INSERT
INSERT ALL
UPDATE
DELETE
TRUNCATE TABLE
ORACLE CLAUSES
DISTINCT
FROM
ORDER BY
GROUP BY
HAVING
ORACLE OPERATORS
UNION
UNION ALL
INTERSECT
MINUS
ORACLE ADVANCE
PROCEDURES
FUNCTION
CURSOR
TRIGGER

SELF JOIN



Oracle - Self Join


Self Join is a specific type of Join. In Self Join, a table is joined with itself (Unary relationship). A self join simply specifies that each rows of a table is combined with itself and every other row of the table.


Syntax :
SELECT a.column_name, b.column_name...   
FROM table1 a, table1 b   
WHERE a.common_filed = b.common_field;   

Oracle SELF JOIN Example


NAMEAGEADDRESSSALARY
Ajaashi21Hyderabad25000
Kaushik22Secunderabad32000
Maulik23Mumbai56000
Nikarsh24Karnataka12000

Join this table using SELF JOIN as follows:

SELECT  a.name, b.age, a.SALARY  
FROM CUSTOMERS a, CUSTOMERS b  
WHERE a.SALARY < b.SALARY; 

Output :

NAMEAGESALARY
Ajaashi2225000
Ajaashi2325000
Kaushik2332000
Nikarsh2112000
Nikarsh2212000
Nikarsh2312000


What Is Oracle

What Is Oracle

posted on 2019-11-29 01:11:21 - ORACLE Tutorials


TRIGGER

ORACLE - Trigger

posted on 2019-11-28 22:14:22 - ORACLE Tutorials


CURSOR

ORACLE - Cursor

posted on 2019-11-28 22:13:54 - ORACLE Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials