SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
with a as(select inventory_id,return_date a1, LEAD(rental_date) over(partition by rental_date order by inventory_id) a2 from rental group by inventory_id select count(between a2 and a1)) as avg_days_between_rentals from a group by a1,a2

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear