SQL Groupby funktioniert nicht, ich möchte nach Code_Branch gruppieren
P粉021553460
P粉021553460 2024-04-06 19:24:49
0
2
671

->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'
)

P粉021553460
P粉021553460

Antworte allen(2)
P粉428986744

转到config/database.php

严格设置为 false

P粉154798196

这是不正确的,您不能对同一列使用单个名称,

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

更改为

'e.code as branch_code',
  'e.id as branch_id',
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage