Question : How to get the sum of a varchar column field with SQL

Hello everyone.

I have a column that has 7 decimal values as a varchar and the decimal values are seperated with space.
For example
188,44 2.090,17 0,00 402,85 0,00 344,51 940,59
186,60 2.085,18 0,00 407,23 0,00 342,43 929,43
etc

What I want to do is to get the sum of these 7 values for each row.
For example to have
3966.56
3950.87
for my rows above.

 How can I do that?

Thanks in advance.

Answer : How to get the sum of a varchar column field with SQL

Hi,

I assume you don't have a current backup? And I assume you deleted the file using "rm" at the commandline (not the graphical "dtfile" or the like)?

If so, and if you actually don't have a backup, things are going to get really complicated or expensive, because AIX has no straightforward mechanism to recover deleted files.

There is a company offering a commercial undelete product for AIX - http://www.compunix.com/prod/analyse.html

Prices go from 2.500 EUR to 4500 EUR.

You can try it using by yourself the filesystem debugger "fsdb". It's awfully complicated, but will work in most cases, given that you follow accurately the steps outlined in this paper - http://www.faqs.org/faqs/aix-faq/part1/section-54.html

Note that you will have to umount the filesystem! If this is not possible, you're lost!

Alas the above article deals with legacy jfs. There are some differences in fsdb when it comes to jfs2. Consult the section "JFS2" subcommands" in "man fsdb" to learn about these differences, if some command mentioned in the article doesn't work as expected.

Please let me know what you're going to do and don't hesitate to ask for assistance!

Good luck!

wmp

Random Solutions  
 
programming4us programming4us