Merge multiple rows with unique value in one column and different values in other columns

Viewed 29

I have a table like this:

| relId    |    edition     |
| -------- | -------------- |
| 1258     |     B02        |
| 1258     |     B03        |
| 4233     |     B03        |

I want to get this:

| relId    | edition1    |  edition2  |
| -------- | ----------- | ---------- |
| 1258     | B02         |    B03     |
| 4233     | B03         |            |

I tried joining the same table and group by, but had no luck.

Any suggestions? Thanks a lot!

0 Answers
Related