Can someone pls suggest a way to write SQL query which would generate a unique UUID which would be same for a group of columns in amazon athena.
For example, i have a table like this, where i want to create a UUID for columns1, columns2 and columns3.
column1 | column2 | column3 | column 4
2016 | 101 | 1 | 25
2016 | 101 | 1 | 59
2017 | 105 | 2 | 57
2017 | 105 | 2 | 78
Output 1 must look like
ID | column1 | column2 | column3 | column 4
UUID-1 | 2016 | 101 | 1 | 25
UUID-1 | 2016 | 101 | 1 | 59
UUID-2 | 2017 | 105 | 2 | 57
UUID-2 | 2017 | 105 | 2 | 78
Output 2: should look like
ID | count |column1 | column2 | column3
UUID-1 | 2 |2016 | 101 | 1
UUID-2 | 2 |2017 | 105 | 2
I understand that grouping can be done on output 1 to generate output 2. Can someone suggest, how i can generate output 1 ?
Thanks.