 |
sql sum เลขทศนิยม select sum filed เลขทศนิยม ให้ออกมาเป็นผลรวม เช่น 1,73,678.00 + 1,500.00 = xxxxxx ผลที่ได้ |
|
 |
|
|
 |
 |
|
ถ้าให้แสดงทศนิยมด้วยแบบนี้ก็ใช้ได้ครับ
Code (PHP)
$ju="SELECT SUM(SumPrice3) as sum_SumPrice3 FROM month2 Where month2='07' and Year='$Year'";
$ju2=mysql_query($ju);
$ju3=mysql_fetch_array($ju2);
$ju4=$ju3['sum_SumPrice3'];
$July=number_format($ju4,2, '.', ',');
|
 |
 |
 |
 |
Date :
2010-06-01 11:42:52 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
SELECT (REPLACE(ฟิวที่จะเอามาบวก1,',','') + REPLACE(ฟิวที่จะเอามาบวก2,',','')) AS sumtotal FROM tbl_test
|
 |
 |
 |
 |
Date :
2010-06-01 15:59:36 |
By :
ความรู้เท่าหางอึ่ง |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|