My query output is the below.

But I need the result to be in the below format.

My query output is the below.

But I need the result to be in the below format.

The output can be achieved as follows -
Setup:-
CREATE TABLE TAB1
(
ID NUMBER,
ATTRNAME VARCHAR2(1024),
ATTRVALUE VARCHAR2(1024)
);
insert into tab1 values (1, 'Name', 'Mark');
insert into tab1 values (1, 'Email', '[email protected]');
insert into tab1 values (1, 'Phone num', '12234');
insert into tab1 values (2, 'Name', 'Julie');
insert into tab1 values (2, 'Email', '[email protected]');
insert into tab1 values (2, 'Phone num', '12234');
Query:-
select * from (
select * from tab1)
pivot(
max(attrvalue) for attrname in ('Name', 'Email','Phone num')
) order by id;
Result:-
ID 'Name' 'Email' 'Phone num'
1 Mark [email protected] 12234
2 Julie [email protected] 12234