Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel group by on subquery

return DB::table('candidates AS c')
    ->select( DB::raw('c.name AS c_name,j.name AS j_name,t.questions AS questions, count(g.grade) as countGrade'))
    ->join('job_openings AS j', 'c.fk_id_job_opening', '=','j.id_job_opening')
    ->join('interview_templates AS t', 'j.fk_id_template', '=', 't.id_template')
    ->join('responses AS r', 'r.fk_id_candidate', '=', 'c.id_candidate')
    ->join('grades AS g', 'r.id_response', '=', 'g.fk_id_response')
    ->where('g.fk_id_user',Auth::id())
    ->groupBy('c_name', 'j_name', 'questions')
    ->get();
Comment

PREVIOUS NEXT
Code Example
Php :: loop index foreach laravel 
Php :: get name custom post type wordpress 
Php :: slug in php 
Php :: php include and require statements 
Php :: php all date formats 
Php :: laravel current date in migration 
Php :: - tijsverkoyen/css-to-inline-styles 2.2.3 requires ext-dom * - the requested PHP extension dom is missing from your system. 
Php :: where_in codeigniter 
Php :: php increment letter 
Php :: laravel storage get file path 
Php :: laravel query builder sum 
Php :: laravel join table 
Php :: php session time out default 
Php :: php pi() function 
Php :: getting last day of next month in php 
Php :: laravel base64 decode save file 
Php :: woocommerce order get_data() 
Php :: max. post size 
Php :: laravel 8 created at format 
Php :: Target class [Controller] does not exist. 
Php :: make select element readonly 
Php :: php sql query where in array 
Php :: separate date from datetime php 
Php :: create view from route laravel 
Php :: php full day name 
Php :: php header allow cross origin 
Php :: php microtime to seconds 
Php :: how to change date formate in php 
Php :: codeigniter table list 
Php :: php mkdir with 777 permission 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =