1 year ago

mysql nested query... How to make it work in laravel query

Posted 1 year ago by jhutto

I've been trying to get this to work for quite awhile now and just need some help. I'm trying to write this query into a controller but can not figure out the format.

SELECT `CourseID`,`StudentID`, `ClassFee`,`HomeOfficeFee`,`MaterialsFee`, (`ClassFee`+`HomeOfficeFee`+`MaterialsFee`) AS TotalTuition, SUM(`PaymentAmount`)
FROM `somascourseregistrations`, `somasstudentclasspayments`
WHERE somascourseregistrations.id = somasstudentclasspayments.RegistrationID AND somascourseregistrations.id = $RegistrationID

Please help

Please sign in or create an account to participate in this conversation.