Is it technically possible to use the result of a recursive CTE as a subquery inside parentheses ? (in MySql)
up vote
1
down vote
favorite
Such as this :
Select * From (
WITH RECURSIVE cte_name AS (
initial_query -- anchor member
UNION ALL
recursive_query -- recursive member that references to the CTE name
)
SELECT * FROM cte_name
) A
mysql subquery common-table-expression recursive-query
add a comment |
up vote
1
down vote
favorite
Such as this :
Select * From (
WITH RECURSIVE cte_name AS (
initial_query -- anchor member
UNION ALL
recursive_query -- recursive member that references to the CTE name
)
SELECT * FROM cte_name
) A
mysql subquery common-table-expression recursive-query
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Such as this :
Select * From (
WITH RECURSIVE cte_name AS (
initial_query -- anchor member
UNION ALL
recursive_query -- recursive member that references to the CTE name
)
SELECT * FROM cte_name
) A
mysql subquery common-table-expression recursive-query
Such as this :
Select * From (
WITH RECURSIVE cte_name AS (
initial_query -- anchor member
UNION ALL
recursive_query -- recursive member that references to the CTE name
)
SELECT * FROM cte_name
) A
mysql subquery common-table-expression recursive-query
mysql subquery common-table-expression recursive-query
edited Nov 9 at 13:46
PM 77-1
8,732134584
8,732134584
asked Nov 9 at 13:44
Whirl Mind
8121717
8121717
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Section 13.2.13 of the MySql 8.0 reference manual that handles WITH syntax for Common Table Expressions, mentions the following :
A WITH clause is permitted in these contexts:
At the beginning of subqueries (including derived table subqueries):
SELECT ... WHERE id IN (WITH ... SELECT ...) ...
SELECT * FROM (WITH ... SELECT ...) AS dt ...
So, that clarifies my question, therefore putting my own answer as a community wiki.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Section 13.2.13 of the MySql 8.0 reference manual that handles WITH syntax for Common Table Expressions, mentions the following :
A WITH clause is permitted in these contexts:
At the beginning of subqueries (including derived table subqueries):
SELECT ... WHERE id IN (WITH ... SELECT ...) ...
SELECT * FROM (WITH ... SELECT ...) AS dt ...
So, that clarifies my question, therefore putting my own answer as a community wiki.
add a comment |
up vote
0
down vote
Section 13.2.13 of the MySql 8.0 reference manual that handles WITH syntax for Common Table Expressions, mentions the following :
A WITH clause is permitted in these contexts:
At the beginning of subqueries (including derived table subqueries):
SELECT ... WHERE id IN (WITH ... SELECT ...) ...
SELECT * FROM (WITH ... SELECT ...) AS dt ...
So, that clarifies my question, therefore putting my own answer as a community wiki.
add a comment |
up vote
0
down vote
up vote
0
down vote
Section 13.2.13 of the MySql 8.0 reference manual that handles WITH syntax for Common Table Expressions, mentions the following :
A WITH clause is permitted in these contexts:
At the beginning of subqueries (including derived table subqueries):
SELECT ... WHERE id IN (WITH ... SELECT ...) ...
SELECT * FROM (WITH ... SELECT ...) AS dt ...
So, that clarifies my question, therefore putting my own answer as a community wiki.
Section 13.2.13 of the MySql 8.0 reference manual that handles WITH syntax for Common Table Expressions, mentions the following :
A WITH clause is permitted in these contexts:
At the beginning of subqueries (including derived table subqueries):
SELECT ... WHERE id IN (WITH ... SELECT ...) ...
SELECT * FROM (WITH ... SELECT ...) AS dt ...
So, that clarifies my question, therefore putting my own answer as a community wiki.
answered Nov 21 at 12:26
community wiki
Whirl Mind
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53226896%2fis-it-technically-possible-to-use-the-result-of-a-recursive-cte-as-a-subquery-in%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown