我想创建一个地图并在同一个 SQL 查询中使用它。我正在尝试类似的东西
select sample_map[t1.col1], t1.col2 from table1 as t1, (select map(1,2,3,4)) as sample_map group by t1.col2;
检查以下
sql
查询。
SELECT
m.s_map[t1.col1] AS m_col1,
t1.col2 AS col2
FROM table1 t1,
(SELECT map(1,2,3,4) as s_map) as m
GROUP BY col2, m_col1