CustID Name ReferredBy
1 Neeta Sayam
2 Dolly Dilly 1
3 Meena Kimi 2
Find the names of all customers who are referred by others.
the output should be dolly dilly and meena kimi.
I have succesfully found out for customers who have reffred others by query
SELECT c1.name FROM Customer c1 JOIN Customer c2 ON c1.custid=c2. ReferredBy