1) You aren't getting earth, because earth is not a first grade ancestor, but second (so you'd have to add another join to the query2) You're getting America twice, because there are two rows in t1 with mom = 2. Use SELECT DISTINCT to get rid of the duplicates

dotJoon
—
2011-06-30T22:55:02Z —
#3

guido2004 said:

1) You aren't getting earth, because earth is not a first grade ancestor, but second (so you'd have to add another join to the query2) You're getting America twice, because there are two rows in t1 with mom = 2. Use SELECT DISTINCT to get rid of the duplicates