Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Also I am having issue even using the alias without the DB::raw.

Like this in this example:

->select('applicationAssessment.applicationID AS appID',...........)..........
->groupBy('appID')

I still get the Column appID (in this case) not found?

Last updated 2 years ago.
0

Post the sql output

Last updated 2 years ago.
0
select 
        `applicationAssessment`.`applicationID` as `appID`, 
        CONCAT(student.lastName, ", ", student.firstName) as name, 
        ROUND (AVG(applicationAssessment.total), 2) + studentDemographics.GPA AS Score, 
         ..............(other non relevant stuff here like joins and what not)
        group by `appID`"
Last updated 2 years ago.
0

I copy/paste word for word the entire query (I'm not showing it all for readability purposes) and it works in SequalPro (OSX) but not in laravel 4

Last updated 2 years ago.
0

Convert your laravel query to plain text with toSql() and execute with laravel DB::select ,worked for me.

$result_query = $query->toSql(); $result = DB::select(DB::raw($result_query));

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.