我有一个SQL查询,在该查询中我加入了三个表,我在SQL QUERY中运行它显示了一些错误,我不知道为什么会出现此错误,如果有人知道请更新我的代码
我的错误是:#2013 - 查询期间与MySQL服务器的连接丢失
我的SQL QUERY
SELECT tm.empId,a.companyId,a.tripId,a.startTime,a.endTime,a.tripDate,c.shiftTiming,c.routeId,c.cabId, a.forceEndStatus,a.tripStatus,c.type, (
select count('*')
from trip_member as m
WHERE m.tripId=a.tripId and m.empPresentStatus = '1'
) as absentcount,(
select count('*')
from trip_member as m
WHERE m.tripId=a.tripId and m.empPresentStatus = '0'
) as presentcount ,(
select count('*')
from trip_member as m
WHERE m.tripId=a.tripId and m.pickupotpStatus = '1'
) as pickupcount
FROM trip_details a
INNER JOIN cab_allocation as c
on c.allocationId = a.allocationId
LEFT JOIN trip_member tm
ON a.tripId = tm.tripId
where c.companyId = '1'
order by a.id desc
LIMIT 0,30
假设我正在移除LEFT JOIN trip_member tm ON a.tripId = tm.tripId
意味着它正常工作,