Distinct values using string_agg

  • Hi

    Is it possible to get distinct values using string_agg

    Select T1."transType",

    WHEN T1."TransType" = '46' THEN (SELECT STRING_AGG (A0."LocCode", ',') from PCH1 A0 inner join OPCH A1 on A0."DocEntry" = A1."DocEntry" and A1."BPLId" = T1."BPLId" inner join VPM2 A2 on A2."DocNum" = T1."CreatedBy" and A0."DocEntry" = A2."DocEntry")

    from JDT1 T1

    Thanks

  • use a "group by" on the string_agg sub query

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply