Forum

Posted by rak, April 19, 2022, 10:27 a.m.

Question 25

I had two solutions 

1#

select film.title, min(film.length) 
from film 
group by film.title,film.length
order by film.length
limit 1;

#2
select film.title 
from film
where film.length = (select min(film.length) from film)

 

The first one was given as a wrong answer, why is that??

 

Answers

Hey there,

The first solution returns 2 columns, the second one column.

-Leon

 

 

SQLPad user avatar

Leon (949)

April 19, 2022, 11:07 a.m.