I have this query
SELECT ANY_VALUE(id) as id, title FROM `major` where university_id=1 group BY `title` order by id asc
I want to convert it into Laravel Query , I have a model majors and the function as follow
public static function retrieveByUniversityIDForWeb($universityId){
return self::select(DB::raw('ANY_VALUE(id) as id, title'))->from('major')->where('university_id', $universityId)->orderBy('id','desc')->simplePaginate(6);
}
but its not returning me the results , query works in phpmyadmin. Any idea what I missed?