Dear Experts,I have a SQL select statement that outputs data as follows.----------------------------
ID Attribute Value
----------------------------
10 username user1
10 password pass1
11 username user2
11 password pass2
---------------------------I want to rotate this table as follows:
--------------------------------
ID username password
--------------------------------
10 user1 pass1
11 user2 pass2
--------------------------------How can I do this? I'm using MYSQL.
ID Attribute Value
----------------------------
10 username user1
10 password pass1
11 username user2
11 password pass2
---------------------------I want to rotate this table as follows:
--------------------------------
ID username password
--------------------------------
10 user1 pass1
11 user2 pass2
--------------------------------How can I do this? I'm using MYSQL.
from (
select ID,Value as username
from yourTable
where Attribute='username') a inner join
(select ID,Value as password
from yourTable
where Attribute='password') b on a.id=b.id