I have a mysql table which has the below structure
id,username,attribute,value,realname,birthdate,phone
and I have these records in the table
1,john,Cleartext-Password,ss,johnsmith,1/1/1990,9786865754
2,john,Expiration,20/1/2018,null,null,null
I want to write a query that shows the below result
username|password|expir |realname|birthdate|phone
john |ss |20/1/2018 |johnsmith|1/1/1990|9786865754
I tried using the query mentioned below. But I don't seem to get the desired result.
select c1.username ,c1.value as 'password',c1.adsoyad,c1.telefon,c1.email,c1.dtarih,c1.tcno,c2.value as 'expired' from radcheck c1 INNER join radcheck c2 on c1.username=c2.username and c1.attribute='Cleartext-Password' and c2.attribute='Expiration' and c1.username='john' and c2.username='john'