0
我可以合併這兩個SQL語句嗎?目前運行2個查詢。試圖收緊一點。MySQL - 我可以結合這兩個SQL語句嗎?結合JOIN和AVG?
第一招:
二SELECT * FROM (`cars`)
JOIN `brands` ON `brands`.`br_id` = `cars`.`brand_id`
WHERE `cars`.`id` = '185707'
之一:
SELECT ROUND(AVG(rating)) as avg_rating
FROM car_ratings WHERE car_id = 185707