SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
SET @mary_smith = (SELECT customer_id FROM customer WHERE first_name = 'MARY' AND last_name = 'SMITH'); WITH tmp AS ( SELECT ROW_NUMBER() OVER(ORDER BY rental_date) AS period_id, rental_date AS from_date, return_date AS to_date FROM rental WHERE customer_id = @mary_smith ) SELECT * FROM tmp ORDER BY from_date LIMIT 5

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear