I want use WhereIn and Groupby in Same Query to fetch Result.
I've tried this:
$loadids=explode("#@*",$reciptdet->loading_id);
$loadingdatas=DB::table('loading')->groupBy('vehicle_no')->whereIn('id',$loadids)->get();
But I got this error message:
SQLSTATE[42000]: Syntax error or access violation: 1055 'sbrtpt.loading.id' isn't in GROUP BY (SQL: select * from loading where id in (14, 15, 16) group by vehicle_no)
loading
whereid
in (14, 15, 16) group byvehicle_no
) @aynber – Karthikvijayaveni