What’s the equivalent for LISTAGG (Oracle database) in PostgreSQL?

The equivalent function in PostgreSQL is STRING_AGG() SELECT STRING_AGG (column_name,’, ‘) FROM my_table string_agg : input values concatenated into a string, separated by delimiter For example, get list of all agreement_id then represent it in a string, in Apache Ofbiz 17.12.04 SELECT STRING_AGG(agreement_id, ‘, ‘) FROM agreement_item; — result — “8000, DS-1000-SALES, DS-1000-PURCH, 9000, AGR_SALES”

LISTAGG in Oracle to return distinct values

19c and later: select listagg(distinct the_column, ‘,’) within group (order by the_column) from the_table 18c and earlier: select listagg(the_column, ‘,’) within group (order by the_column) from ( select distinct the_column from the_table ) t If you need more columns, something like this might be what you are looking for: select col1, listagg(col2, ‘,’) within group … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)