What is the shortest or fastest SQL select query or SQL procedure to crawl a social graph. Imagine we have this table:

```
UId FriendId
1   2
2   1
2   4
1   3
5   7
7   5
7   8
5   9
9   7

```

We have two subset of people here, i'm talking about a sql query or procedure which if we pass:

Uid = 4 return the result set rows with `uid : {1, 2, 3}`

or if

Uid = 9 return the result set rows with `uid : {5, 7, 8}`

Sorry for my poor english.