Is there a way to retrieve a set of rows from a table but also including (join, union?) rows from the same table whose ids are referenced in the initial selection? Here's an example.
ID Name Surname UserID ParentID
--------------------------- ------------------
1 Daniel Brown 1 0
2 John Brown 2 4
3 Andrew Brown 3 5
4 Simon Smith 4 0
5 Peter Smith 5 1
So I want to retrieve all the rows where the surname is Brown, and also all the rows pertaining to the parent value. In this example, all rows would be returned.
I would like to do this in one query, if it's possible. Note, I would not want to return Peter Smith's parent row (1) as well. Just the initial search (all the Browns) and the relevant parents to that initial search.