View previous topic :: View next topic |
Author |
Message |
monaco Beginner
Joined: 20 May 2004 Posts: 77 Topics: 31
|
Posted: Wed Jun 02, 2004 12:40 pm Post subject: sum columns defined as CHAR |
|
|
Hi all,
can we do aritmetics operational with columns defined as a CHAR?
I've been testing and i know that:
SELECT SUM(DECIMAL('column name'))
works.
But, is there any risk? Shall i consider something before to create the columns?
Kind regards. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Jun 02, 2004 12:49 pm Post subject: |
|
|
monaco,
The answer depends on the data you are trying to insert into the db2 column.If you are sure that you will only insert numeric values then you can change the column definition to decimal or Integer.
Using decimal or integer fucntion on character data involves the conversion routine to be invoked and this might effect the performance in the long run.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|