I have 4 tables
we_vehicles_coordinates
we_vehicles
we_drivers
we_clients
SELECT mrk_lat,we_clients.client_id,mrk_lng ,engine_status ,created_date,live_fuel,
count(we_drivers.driver_id) as total_drivers,
count(we_vehicles.veh_id) as total_veh,
count(we_vehicles.veh_status) as run_veh,
count(we_vehicles.veh_status) as stop_veh
FROM `we_vehicles_coordinates`
INNER JOIN we_vehicles ON
we_vehicles.veh_id = we_vehicles_coordinates.veh_id
INNER JOIN we_drivers ON
we_drivers.veh_id = we_vehicles.veh_id
INNER JOIN we_clients ON
we_clients.client_id = we_vehicles.client_id
WHERE (we_vehicles.veh_status='1') AND
(we_vehicles.veh_status='0') AND
(we_clients.client_id= 3)
It gives me null and 0.
Tried a lot but didn't got success.
Thanks
issue 1. aggregate function without group byissue 2. perhaps no matching record with inner join. So better provide some sample data and expected result.