Can you please tell me how can I convert the data which is in multiple columns to 1 single row?
To be converted like this:
Appreciate any help!
You select a field from the table union all with the second field and union all with the third field. You can convert the data type to the same for all. You can select distinct for the one you want.
Your data output is not understandable, Can you please give some more description? and also paste the data in correct format?
Like currently, it seems that you want to see this data in a coolumn!
max(case when name ='a' then value else null end) as A,
max(case when name ='b' then value else null end) as B,
group by 1
If you want to put data in all columns into a single column then the technique advised by Raja will obviously work. But if you want to place the data in these column into a single row then you might have to transpose you data.