I have a table:
Table1
row_id var var_val
1 Test 1 123
1 Test 2 456
1 Test 3 789
1 Test 4 1234
2 Test 1 665t
2 Test 2 dsfs
2 Test 3 df
2 Test 4 sfd
3 Test 1 sfs
3 Test 2 sf
3 Test 3 sdfs
3 Test 4 sfsd
Here is the output:
Table2
row_id var1 var2
1 123 456
2 665t dsfs
3 sfs sf
- For var1 - get value where var = "Test 1"
- For var2 - get value where var = "Test 2"
Is there a way to use pivot or some way of extracting the variable for each row_id from the table1 as per above?