1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Hi, The problem seems to be in the select statement and not cross join. If I use the below statement instead, cross join works as expected.
WITH RECURSIVE
item_array AS ( SELECT JSON_PARSE('[7, 8, 9]') AS items ),
idx_array(idx) AS ( SELECT 1 AS idx UNION ALL SELECT idx + 1 AS idx FROM idx_array WHERE idx < 2 )
SELECT * FROM item_array CROSS JOIN idx_array;
It gives me
items | idx
---------+-----
[7,8,9] | 1
[7,8,9] | 2
(2 rows)
Contenus pertinents
- demandé il y a un an
- demandé il y a 2 mois
- Réponse acceptéedemandé il y a un an
- demandé il y a 9 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a un an
Firstly, thank you for looking into this! It works with
SELECT *
orSELECT items
. But when you indexitems
as inSELECT items[0]
, it fails. So, does that meanitems
is no longerSUPER
?; which goes back to the original question whetherSUPER
types are not supported with recursive CTEs. Thank you!