Vasilis Spilka
10/13/2023, 12:47 PMGROUP BY
query I am trying to use something equivalent to PostgreSQL’s string_agg
or Oracle’s LISTAGG
, I noticed that there is a function CONCAT
in https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_158513731864.html#SuiteQL-Supported-and-Unsupported-Functions , that could combine the strings but it’s not working for me giving back
%{
"detail" => "Invalid search query. Detailed unprocessed description follows. Search error occurred: Invalid or unsupported search.",
"o:errorCode" => "INVALID_PARAMETER",
"o:errorQueryParam" => "q"
}
(for the record COUNT works), is there a way to combine a resulting list of strings into one? Preferably with a delimeter I can setVasilis Spilka
10/13/2023, 12:55 PMVasilis Spilka
10/13/2023, 12:56 PMClay Roper
10/13/2023, 3:00 PMShai Coleman
10/13/2023, 3:20 PMWITH t2 AS (
SELECT transaction.id AS transaction_id, transactionline.uniquekey
FROM transaction
INNER JOIN transactionline ON (transactionline.transaction = transaction.id)
FETCH FIRST 1000 ROWS ONLY
)
SELECT t2.transaction_id,
LISTAGG(t2.uniquekey, ', ') WITHIN GROUP (ORDER BY t2.uniquekey) AS transactionline_uniquekeys
FROM t2
GROUP BY t2.transaction_id
ORDER BY t2.transaction_id
Vasilis Spilka
10/13/2023, 3:20 PM