postgresql - Convert one column to multiple columns in postgres -


i have table below :

enter image description here

would change format below on postgres :

enter image description here

i tried use case statement did not give me desired results. thank in advance !

edit

select (case when column_1='a' column_1 else 'other' end) column_1, (case when column_1='b' column_1 else 'other' end) column_2 test_t  id= random_value; 

each time query returns 2 rows , row values in column_1 dynamic , not fixed.

you didn't provide enough information answer question how convert 2 rows 1 column 2 columns , forced single row.

select max(column_1) column_1, max(column_2) column_2 (select case when column_1 = 'a' column_1 else '' end column_1,              case when column_1 = 'b' column_1 else '' end column_2       table_name);