leezac
asked on
Combine two columns
How do I combine to columns. I am trying this way but get an error "invalid number". Both columns are Characters (text and numbers)
SELECT DVSN_NM ,Fund_C + '' + Fund_Shrt_NM) as Fund_Name
FROM
dbo.V_BAL_MO BALMO
--
SELECT DVSN_NM ,Fund_C + '' + Fund_Shrt_NM) as Fund_Name
FROM
dbo.V_BAL_MO BALMO
--
CONCAT(Fund_C, '', Fund_Shrt_NM)
Also:
Fund_C || Fund_Shrt_NM
An empty string in Oracle is a NULL value so it does nothing to have it.
Fund_C || Fund_Shrt_NM
An empty string in Oracle is a NULL value so it does nothing to have it.
I presumed they were trying to add a space or something between them - maybe not...
just use "||" instead of "+"
Fund_C + '' + Fund_Shrt_NM
>>>
Fund_C || '' || Fund_Shrt_NM
Fund_C + '' + Fund_Shrt_NM
>>>
Fund_C || '' || Fund_Shrt_NM
Incorrect concatenation character and the extra right-parenthesis before as Fund_Name needs to be removed:
SELECT DVSN_NM
, Fund_C || ' ' || Fund_Shrt_NM as Fund_Name
FROM V_BAL_MO
ASKER
Well actually a hyphen ABCD-Trust Dept. Slightwv worked - no space or hyphen
I would guess that as well but what is posted will not do that. You would need to physically add the space in it:
Fund_C || ' ' || Fund_Shrt_NM
I missed this when I posted: Your CONCAT syntax is invalid. CONCAT takes two parameters only. Anything more will result in an error.
You use concat with 3 parameters you need to nested concat calls:
CONCAT(Fund_C, CONCAT(' ', Fund_Shrt_NM))
Fund_C || ' ' || Fund_Shrt_NM
I missed this when I posted: Your CONCAT syntax is invalid. CONCAT takes two parameters only. Anything more will result in an error.
You use concat with 3 parameters you need to nested concat calls:
CONCAT(Fund_C, CONCAT(' ', Fund_Shrt_NM))
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
My previous browser was not allowing me to award points. Thanks for help