search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

2 answers
Q&A sql groupby not working, I want to group by code_branch
sql groupby not working, I want to group by code_branch
P粉021553460 2024-04-06 19:24:49 Views 1151
PHP

0

->select
(
  'a.status as status',
  'b.name as customer_name', 
  'e.name as branch_name' , 
  'c.name as company_name',
  'd.name as project_name',
  'f.name as region_name',
  'e.code as branch_code',
  'e.id as branch_code',
  DB::raw('COUNT(a.id) as total_transaksi')
)
->groupBy
(
  'e.id',
  'b.name',
  'e.name', 
  'e.code',
  'a.status',
  'c.name',
  'd.name',
  'f.name'
)
Your Answer
submit

2 answers
0

This is incorrect, you cannot use a single name for the same column,

'e.code as branch_code',
  'e.id as branch_code',

change to

'e.code as branch_code',
  'e.id as branch_id',
2024-04-07 10:38:57

submit

0

Go to config/database.php

Strictly set to false

2024-04-07 15:24:03

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use