|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to merge 2 char fields in select statement
Hi!
I am newbie with Firebird, because I am using it with my projects for a few weeks now. I jumped from Microsoft SQL and I would like to know can to solve the following... I have 2 char fields in database: NAME and SURNAME for example. In SQL it was possible to make the following statement: SELECT NAME + ' ' + SURNAME AS FULL_NAME FROM TABLE But here in Firebird I get error. Any solutions? What I am trying to do is to show 2 char fields single columns combo box control. That's why I need 1 field as ID, and 1 field for text displayed in combobox. I don't have multi column control in this case so I have to figure how to merge to 2 char fields? Regards! Uros |
|
#2
|
||||
|
||||
|
Because + is NON standard way of putting two fields together, the standard operator is ||
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
In addition to that answer...
If any of the columns is NULL, a concatenate will return NULL as well: 'TEST' || ' ' || 'TEST' = 'TEST TEST' NULL || ' ' || 'TEST' = NULL Keep that in the back of your head ![]() Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > How to merge 2 char fields in select statement |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|