Sql AWS Athena:将逗号分隔的字符串转换为行
在AWS Athena中,我想编写如下查询:Sql AWS Athena:将逗号分隔的字符串转换为行,sql,presto,amazon-athena,Sql,Presto,Amazon Athena,在AWS Athena中,我想编写如下查询: SELECT some_function('row1,row2,row3'); 回来 row1 row2 row3 我该怎么做 我知道我可以写这个,但对我来说不太方便: select * from (values ('row1'), ('row2'), ('row3')) 可以使用函数将字符串转换为数组,然后将数组转换为行。例如: 以t作为 选择“行1、行2、行3”作为数据 选择值 从t 交叉连接unnestsplit.data','作为xva
SELECT some_function('row1,row2,row3');
回来
row1
row2
row3
我该怎么做
我知道我可以写这个,但对我来说不太方便:
select * from (values ('row1'), ('row2'), ('row3'))
可以使用函数将字符串转换为数组,然后将数组转换为行。例如:
以t作为
选择“行1、行2、行3”作为数据
选择值
从t
交叉连接unnestsplit.data','作为xvalue
value
-------
row1
row2
row3
(3 rows)