select B.name, count(B.items) as count, concat_ws('|',collect_list(B.items)) as items from (select distinct name,items,item_rank from SourceA)B group by B.name order by B.item_rank
错误无效的列引用item_rank
尝试在输出中输出nameofperson,count(items),list of items (pen,paper,book..)
但订单应该从item_rank
按升序维护
example : pen item_rank 1, paper item_rank 2, book item_rank 3
项目顺序应按照像“笔,纸,书籍”中的排名按升序列出
我的collect_list输出被搞砸了笔,书,纸,当我按照子查询保持顺序时它不跟随排名
如果我在外面保留订单,我会错误无效列参考item_rank
哪里出错
感谢