Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Expression #1 of ORDER BY contains aggregate function and applies to the result of a non-aggregated query laravel

1. set strict to false in config/databtase.php 
2. ->select([
		'exam_registrations.id',
        'exam_registrations.exam_id',
        'exam_registrations.user_id',
        DB::raw('sum(submissions.marks) as totalMarksGained')
     ])
     ->groupBy('exam_registrations.user_id')
     ->orderBy('totalMarksGained', 'DESC')
Comment

PREVIOUS NEXT
Code Example
Php :: user input in oop php 
Php :: twig lower case and string replace 
Php :: carbon parse 
Php :: OR criteria 
Php :: create associative array php by key value site:stackoverflow.com 
Php :: default time zone for europe php 
Php :: string replace in php 
Php :: php type generic object 
Php :: Undefined property: CI::$file 
Php :: php zoom api start_time issue 
Php :: eager load relationships on an existing model in route laravel 
Php :: itop cron.php 
Php :: php resize 
Php :: livewire component lost data 
Php :: Verifying a login cookie 
Php :: 12 months service expiary in php 
Php :: how to set selected value in dropdown using php 
Php :: get base class name laravel 
Php :: wordpress get_permalink not working 
Php :: how to explode results from multi select form submitted 
Php :: php pdo memory exhausted 
Php :: generate press viewport 
Php :: wp dev tehem support widget 
Php :: ajouter une panier php 
Php :: how to follow unfollow on buddypress ajax call 
Php :: Hide products only show assigned products to certain user roles in WooCommerce 
Php :: how do istart writing a php code 
Php :: how to write double values in phpmyadmin 
Php :: changing the autoload.php for algolia search 
Php :: laravel file upload 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =