Can Anyone Give Me The Example Of Self Join ?

Forums SQLCan Anyone Give Me The Example Of Self Join ?
Staff asked 4 weeks ago

Answers (1)

Add Answer
Umang Ramani Marked As Accepted
Staff answered 4 weeks ago
SELECT A.customername AS CustomerName1,
       B.customername AS CustomerName2,
       A.city
FROM   customers A,
       customers B
WHERE  A.customerid <> B.customerid
       AND A.city = B.city
ORDER  BY A.city;

 

Subscribe

Select Categories