PHP Mysql SUM with decimal format -


i have table has column : balance_amount of type varchar

now i'm facing problem when want sum.

example:

if have content column :

125,000.00 170,000.00 

it show : 295

what want : 295,000.00

here sqlfiddle

select format(sum(cast(replace(replace(col,',00',''),'.','') signed)), 2)    sumofcolumn     tab 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -