trino类型转换为不区分大小写的行



我有一个类似的sql

select
cast (cast("cf00a399af"."2be9fc3823" as json) as row(cityId bigint, city varchar)) as 
address,
count(0) as num
from  ygg_dev."913852142333198336" cf00a399af
group by "cf00a399af"."2be9fc3823"

我的结果是这个

地址num
{cityid=44,城市=石家庄市}1
{cityid=23,城市=天津市}1
{cityid=1318,城市=泉州市}1
{cityid=0,city=}9
{cityid=1274,城市=福州市}1
{cityid=1318,城市=泉州市}1
{cityid=2,城市=北京市}1
{cityid=1318,城市=泉州市}2

"默认情况下";作为列的行字段名不区分大小写:

select r.cityId c1, r.CITYID c2, r.cityid c3
from (select cast(row(1, 'cityname') as row(cityId bigint, city varchar)) r) ;

输出:

c1c2c3
111

相关内容

  • 没有找到相关文章

最新更新