luxmraj 0 Newbie Poster

How to re-write this self-join queries by
using the sub-query Structure (without using the CONNECT BY
clause)?

SELECT f1.child as parent, f2.child
FROM FamilyTree f1, FamilyTree f2
WHERE f1.child = f2.parent
SELECT f1.child as grandparent, f3.child as grandchild
FROM FamilyTree f1, FamilyTree f2, FamilyTree f3
WHERE f1.child = f2.parent AND
f2.child = f3.parent

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.