sql - hive group by and order by collect list -


select b.name, count(b.items) count, concat_ws('|',collect_list(b.items)) items (select distinct name,items,item_rank sourcea)b group b.name order b.item_rank

error invalid column reference item_rank

try output nameofperson,count(items),list of items (pen,paper,book..) @ output order should maintained item_rank in ascending order

example : pen item_rank 1, paper item_rank 2, book item_rank 3

item order should in ascending per rank pen, paper,book in collect_list

my output of collect_list screwed pen,book,paper, not following rank when keep order inside subquery

if keep order outside error invalid column reference item_rank

where going wrong

thanks


Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

java - Vaadin 7 Pass Data Between Views -