UNNEST 就是将sql 里面的数据展开

select DISTINCT(item) from (select * from `mafia1_dmd.exchange_info` where timestamp >= '2020-01-01')
item 	

21057577;10|21055526;10|21055525;35|21055481;50|21055480;50
21055821;20|21055835;30|21000049;6|21000048;10|21010004;2|21010002;4
21055823;20|21055835;30|21000049;6|21000048;10|21010004;2|21010002;4
21020002;1|21000074;1|21040008;1|21010004;1
select DISTINCT(item) from (select * from `mafia1_dmd.exchange_info` where timestamp >= '2020-01-01'), UNNEST(split(item, '|')) as item
item 	
21055480;10
21055479;40
21055525;2
21010013;50
posted @ 2022-08-19 22:51  luoganttcc  阅读(8)  评论(0)    收藏  举报