select `cars`.*, (selectcount(*) from `car_favorites` where `cars`.`id` = `car_favorites`.`car_id` and `car_favorites`.`deleted_at` isnull) as `favorite_count`, (selectcount(*) from `user_visit_cars` where `cars`.`id` = `user_visit_cars`.`car_id` and `user_visit_cars`.`deleted_at` isnull) as `user_visit_car_count` from `cars` where (`status` =1) and `cars`.`id` =1171and `cars`.`deleted_at` isnull limit 1
selectCOUNT(user_visit_cars.id) as user_visit_car_count from `cars` innerjoin `user_visit_cars` on `user_visit_cars`.`car_id` = `cars`.`id` and `user_visit_cars`.`deleted_at` isnullwhere `cars`.`status` =1and `cars`.`deleted_at` isnullgroupby `cars`.`id` having `user_visit_car_count` >0
selectcount(*) as aggregate from `user_visit_cars` where `user_visit_cars`.`car_id` =1171and `user_visit_cars`.`car_id` isnotnulland `user_visit_cars`.`deleted_at` isnull