I am attempting to group the data in this table so that it will be displayed as shown below.
Original Data
Student Fruit 1 Fruit 2
Tom Apple Banana
Tom Banana Apple
Gary Apple Banana
Grouped Data
Student Fruit 1 Fruit 2 Count Repeated Condition
Tom Apple Banana 2 True
Gary Apple Banana 1 False
Does anyone know how I can achieve this easily using Google BigQuery? The order is not important. I have experimented with String_AGG and Concat functions but the order matters.
Working on developing a function that aims to create the desired grouped table.