Subject Re: [firebird-support] how can i concatenate 2 columns inside a select?
Author Helen Borrie
At 02:06 PM 3/01/2005 +0000, you wrote:


>how can i concatenate 2 columns inside a select?
>
>in FoxPro i was able to do something like this:
>SELECT FISTNAME+" "+LASTNAME AS NAME FROM USERS
>
>the result was ONE COLUMN made from the concatenation of
>FirstName,LastName and a blank space
>
>How can i do such thing in FireBird ?

Yes. SQL concatentation uses the "double-pipe" symbol, and SQL strings are
delimited by single quotes, so:

SELECT FISTNAME || ' ' || LASTNAME AS NAME FROM USERS

Watch out for nulls, too. If FISTNAME or LASTNAME is null in this
expression, then the whole expression will be null.

Please DO get hold of the Quick Start Guide from the Firebird web site. It
will alert you to several such behavours of SQL.

./hb