mercredi 2 mars 2016

How to write Subquery in Select statement laravel 5.1?

How to write this query in laravel 5.1

SELECT 
     (SELECT firstname FROM registration_details a INNER JOIN users b 
        ON a.id = b.registerid
        WHERE c.patientid = b.id ) AS patient,
     (SELECT firstname FROM registration_details a INNER JOIN users b 
        ON a.id = b.registerid 
        WHERE c.doctorid = b.id ) AS doctor, 
    c.`appoinmentdate`
FROM `appoinments` c



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire