View previous topic :: View next topic
|
Author |
Message |
Anamikaa
New User
Joined: 13 Apr 2010 Posts: 2 Location: SanDiego,USA
|
|
|
|
Hi! There are two decimal data columns in a DB2 table.
Col 1 is Decimal(5,0) and col2 is decimal(5,0).
I want to add both these column datas in my sql query.
Can you please help.
ex.
SELECT COL1,COL2, COL1+COL2 FROM TABLE |
|
Back to top |
|
|
Anamikaa
New User
Joined: 13 Apr 2010 Posts: 2 Location: SanDiego,USA
|
|
|
|
I tried to use digits( function. I didn't get any SQL error.
But the result is not getting displayed |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
col1 + col2 works fine for me. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
i think it is working for numerica data...
select col,col2,col1 + col2 from table |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
cmsmoon wrote: |
i think it is working for numerica data...
select col,col2,col1 + col2 from table |
Addition is not defined for nonnumeric data!!! |
|
Back to top |
|
|
|