Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to do group by then concatenate in QS script?
For Example
A B
-----------
A1 B1
A2 B2
A1 B2
A2 B4
I want the result is
A1 B1,B2
A2 B2,B4
I want group by A then concatenate the value in B
In Sql:
SELECT A, LISTAGG(B, ',') WITHIN GROUP (ORDER BY A) AS BFROM table GROUP BY A;
Try this,
Load A,Concat(B,',') as ConcateField
From XYZ
Group by A;
Try this,
Load A,Concat(B,',') as ConcateField
From XYZ
Group by A;