My tables: 

```
//             friendships
+-----------------+-----------------+-----------------+
|      fid        |     person1     |     person2     | 
|-----------------+-----------------|-----------------+
+-----------------+-----------------+-----------------+
|       1         |    personid     |   personid      |
|-----------------+-----------------|-----------------+
|       2         |    personid     |   personid      |
|-----------------+-----------------|-----------------+

//             persons
+-----------------+-----------------+-----------------+
|      pid        |     firstname   |     lastname    | 
|-----------------+-----------------|-----------------+
+-----------------+-----------------+-----------------+
|       1         |    name         |    name         |
|-----------------+-----------------|-----------------+
|       2         |    name         |     name        |
|-----------------+-----------------|-----------------+

```

1 ) I want to get all rows in the friendships table which contain a certain personid. This id can be either in the person1 or person2 column. The `fid` column should be preserved, but the `person` columns should only be one, e.g.:

```
 Select fid, person1 as person, person2 as person FROM friendships
 WHERE person1 = some_personid
 OR person2 = some_personid;

```

(the 2 person columns from this query should be only one). How do I do that?

2) I want to join the persons table on the result from step 1 `ON fid.person = persons.pid`.