Are the following two groups of code equivalent or not?


#1

SELECT id
FROM flights AS f
WHERE distance > (
SELECT AVG(distance)
FROM flights
WHERE carrier = f.carrier);

versus

select id from flights where distance > (
select avg(distance) from flights
group by carrier);


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.