lundi 28 mai 2018

Convert mysql query to working with laravel

I have this mysql query which is working fine for me and now I decided to convert my project to laravel project so I want to convert mysql query to laravel query this is my query

    select c.username,
   max(case when c.attribute = 'Cleartext-Password' then c.value end) as password,
   max(case when c.attribute = 'Expiration' then c.value end) as expiration,
    max(case when c.attribute = 'ChilliSpot-Max-Total-Octets' then c.value end) as quta,
     max(case when c.attribute = 'Simultaneous-Use' then c.value end) as simul,
 max(case when c.attribute = 'Max-All-Session' then c.value end) as session,
   max(c.adsoyad) as realname, min(c.dtarih) as birthdate, min(c.telefon) as phone,min(c.tcno) as tc,max(c.email) as email,min(c.id) as id
 from radcheck c 
group by c.username

how can I do it 



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire