Hi all,

Consider the following (My)SQL query I'm using:
Code:
	SELECT * 
	FROM `PageRelations` 
	WHERE `ancestor` IN (
		SELECT `descendant` FROM `PageRelations` WHERE `ancestor` = 1
	)
	OR `descendant` IN (
		SELECT `descendant` FROM `PageRelations` WHERE `ancestor` = 1
	)
The red marked sub-queries are identical, and I was wondering whether there is a way to only have the sub-query run once?

Thanks