how do I concat two string column in suiteql
# ask-stanley-ai
a
how do I concat two string column in suiteql
c
AI generated answer (using internal Slack threads):
In SuiteQL, you can concatenate two string columns using the "||" operator. Here is an example:
Copy code
SQL
SELECT
    ID,
    (LastName || ', ' || FirstName) AS FullName,
    Phone,
    Email
FROM
    Employee
WHERE
    Email LIKE '%@test.com'
ORDER BY
    LastName,
    FirstName
In this example, the
LastName
and
FirstName
columns are concatenated together with a comma and a space in between, and the result is aliased as
FullName
. However, if you want to concatenate multiple rows into one row based on some grouping, similar to the
ns_concat
function in NetSuite saved search, SuiteQL does not directly support this. Oracle's
LISTAGG
function is also not supported in SuiteQL. You might be able to achieve this with a subquery or by pulling the results and flattening them in SuiteScript, but it would be more complex and might not be as efficient. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817950487
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.794370055
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.789522946
Please provide your feedback on this answer.