MySQL Forums
Forum List  »  Newbie

Recursive Query
Posted by: terry clear
Date: August 27, 2021 02:55PM

Learning how to write recursive queries.
I have the basics down and can get the desired results.

What I need help with is writing a query
using the table from the recursive query.

Using this simple example
WITH RECURSIVE YR_RNG (YR_RNG) AS
(SELECT -2
UNION ALL
SELECT YR_RNG +1
FROM YR_RNG
WHERE YR_RNG <3)

SELECT *
FROM YR_RNG;


How can a create a query to reference this YR_RNG table?

Options: ReplyQuote


Subject
Written By
Posted
Recursive Query
August 27, 2021 02:55PM
August 27, 2021 03:41PM
August 30, 2021 08:59AM
August 31, 2021 09:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.