Here is the code:
SELECT “Notes1”.“Root Domain”, “Notes1”.“Contact”, ( “Notes1”.“Notes” || ( CASE WHEN “Notes2”.“Notes” IS NULL THEN “” ELSE “Notes2”.“Notes” END ) ) AS “Notes” FROM “Notes” AS “Notes1” LEFT OUTER JOIN “Notes” AS “Notes2” ON “Notes1”.“Root Domain” = “Notes2”.“Root Domain” AND “Notes1”.“Contact” = “Notes2”.“Contact” AND “Notes2”.“Stage” = 4 WHERE “Notes1”.“Stage” = 1
I had issues with CONCAT giving an out-of-range error (I was inserting padding in the concatenation) which || fixed. The idea is to see the “Notes1”.“Notes” when there is no “Notes2”.“Notes” - stopping the whole text being NULLed.
The message means nothing to me as I do not program in JAVA - “Unexpected token: in statement”
Is there a guide to the LibreOffice SQL syntax somewhere?