SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
select avg(datediff(return_date, lg)) as avg_days_between_rentals from ( select inventory_id, return_date, lag(rental_date) over (partition by inventory_id order by rental_date) as lg from rental )t

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear