I have one SQL query , in that query i joined three tables and i run in SQL QUERY it is showing some error, i am not getting why this error coming ,if anyone knows means please update my code
my error is: #2013 - Lost connection to MySQL server during query
My 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
Suppose i am removing LEFT JOIN trip_member tm ON a.tripId = tm.tripId
means it is working fine,