Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i have data like below in Database file
INPUT:
Employee Table:
ExmName EmpId Location
AA 101 BANGLORE
AA 101 MUMBAI
AA 101 CHENNAI
BB 102 BANGLORE
CC 103 CHENNAI
CC 103 HYD
DESIRED OUTPUT:
ExmName EmpId Location
AA 101 BANGLORE,MUMBAI,CHENNAI
BB 102 BANGLORE
CC 103 CHENNAI,HYD
how can i achieve this?
Create a straight table with ExmName and EmpId as dimensions and as expression concat(Location, ',')
Or if you want to do it in the script:
Result:
LOAD ExmName, EmpId, concat(Location, ',') as Locations
RESIDENT INPUT
GROUP BY ExmName, EmpId;
Create a straight table with ExmName and EmpId as dimensions and as expression concat(Location, ',')
Or if you want to do it in the script:
Result:
LOAD ExmName, EmpId, concat(Location, ',') as Locations
RESIDENT INPUT
GROUP BY ExmName, EmpId;
Thanks .It works as expected