I have a database like this

foo1 bar1 ---- ----- 1
foo2 bar2 ----- --------- 1
foo3 bar3 -------- --------- 1
foo1 barA -------- ----------- 2
foo2 barB -------- ----------- 2
foo3 barC -------- ----------- 2

I need a view created. The logic behind it is this ->
foo1 foo2 foo3
bar1 bar2 bar3
barA barB barC

Basically, the column names in the view come from the values of "COL1" from the original table, (for every unique event ID), and the values come from COL2 of the original table for each of those COL1 values.

Basically, I am trying to "transpose" the database matrix, if that makes sense.

Every event ID is always guaranteed to have the n rows (foo1, foo2, foo3) which get transposed to the column names.

I don't know where to even start. Any suggestions on getting me started down a path?