大家好,我有问题。
我有两个返回不同结果的 SQL 查询:
SELECT name, capacity, $price, licensed, cost
FROM venue, catering WHERE venue.venue_id = catering.venue_id
AND grade=$grade
AND capacity >= $minCapacity
AND capacity <= $maxCapacity
AND venue.venue_id
NOT IN (SELECT venue_id FROM venue_booking WHERE date_booked = $us_date)
也
SELECT venue.venue_id,name,capacity,licensed,$price,cost
FROM venue
JOIN catering ON venue.venue_id = catering.venue_id
WHERE capacity BETWEEN '$minCapacity' AND '$maxCapacity'
AND venue.venue_id NOT IN
(SELECT venue_id
FROM venue_booking
WHERE date_booked = '$us_date')
AND catering.grade = '$grade' ORDER BY venue.capacity
这里有什么区别?