左连接查询中的两个列的连续

时间:2015-11-04 12:46:29

标签: php mysql sql email zend-framework

$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_name的查询 concat (FirstName,'' ,LastName ) as Employee_name我该怎么做?

1 个答案:

答案 0 :(得分:0)

你可以不在选择中吗?如:

(FirstName + '' + LastName) as Employee_Name