SQL - Concatenation of expression error -
i working through book called 'sql queries mere mortals' , having major issue 'concatenation of expressions'.
i trying run simple command follows:
select empfirstname || ' ' || emplastname, 'phone number: ' || empphonenumber employees
however, sql server 2008r2
, sql server 2005
both giving me same error message:
msg 102, level 15, state 1, line 1 incorrect syntax near '|'.
i bemused because following text of book , should work, not.
you should use +
instead of ||
select empfirstname + ' ' + emplastname, 'phone number: ' + empphonenumber employees
correct concatenation symbol on sql server +
.
Comments
Post a Comment