You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could not find a solution for task 9 that uses the tools learned so far (the suggested solution is not working, since alias and window functions are not supported in 'where' clauses). Workaround would be with subqueries, but it is a topic to be presented in the next unit.
Workaround:
select * from (select rental_id, inventory_id, datediff(return_date, rental_date) num_days, avg(datediff(return_date, rental_date)) over (partition by inventory_id) avg_return_days
from rental) as t
where t.num_days < t.avg_return_days;
The text was updated successfully, but these errors were encountered:
@sandrabosk
Could not find a solution for task 9 that uses the tools learned so far (the suggested solution is not working, since alias and window functions are not supported in 'where' clauses). Workaround would be with subqueries, but it is a topic to be presented in the next unit.
Workaround:
select * from (select rental_id, inventory_id, datediff(return_date, rental_date) num_days, avg(datediff(return_date, rental_date)) over (partition by inventory_id) avg_return_days
from rental) as t
where t.num_days < t.avg_return_days;
The text was updated successfully, but these errors were encountered: