gpt4 book ai didi

php - 左连接查询中两列的连接

转载 作者:行者123 更新时间:2023-11-29 21:52:14 26 4
gpt4 key购买 nike

$select->columns(array('TableReservationId', 'TableId', 
'ReservationDate', 'StartTime',
'NumberOfGuests', 'AdditinalInfo',
'StaffID', 'MerchantId', 'cust_id'
)
);

$select->join($cus, "$dtr.cust_id=$cus.cust_id",
array('cust_firstName','cust_lastName'),
'left');

$select->join($mer, "$dtr.MerchantId=$mer.MerchantId",
array('FirstName','LastName'),
'left');

$select->join($staff, "$dtr.StaffID=$staff.StaffID",
array('FirstName','LastName'),
'left');

这是我想要的查询 concat (FirstName,'' ,LastName ) as customer_nameconcat (FirstName,'',LastName) as Employee_name 我该怎么做?

最佳答案

你不能把它放在选择中吗?如:

(FirstName + '' + LastName) as Employee_Name

关于php - 左连接查询中两列的连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33522355/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com