Subject RE: [firebird-support] Concatenation of fields
Author Thomas Steinmaurer
> How do I concatenate two fields in a select statement with extra charcaters
> ? the following all throw errors.
>
> SELECT Field1 + '(' + Field2 + ')'
> FROM Table;
>
> SELECT Field1 & '(' & Field2 & ')'
> FROM Table;
>
> SELECT Field1 + "("+ Field2 + ")"
> FROM Table;
>
> SELECT Field1 & "(" & Field2 & ")"
> FROM Table;
>
> SELECT CONCAT(Field1,Field2)
> FROM Table;

Use the double pipe symbol ||.

SELECT Field1 || '(' || Field2 || ')'

Be aware, if one of the arguments is NULL, the entire concatenation
will be NULL.


Best Regards,
Thomas Steinmaurer

Logging/Auditing Suites for InterBase, Firebird and Advantage Database Server
http://www.iblogmanager.com
http://www.adslogmanager.com