вам не нужно ничего делать в конце sql. Вы хотите отформатировать десятичное значение в php (предполагается, что php4 / php5): установите третий параметр $ dec_point в ','
// string number_format ( float $number , int $decimals , string $dec_point , string $thousands_sep )
<?php
$number = 1234.56;
// French notation
$nombre_format_francais = number_format($number, 2, ',', ' ');
// 1 234,56
$number = 1234.5678;
// english notation without thousands seperator
$english_format_number = number_format($number, 2, '.', '');
// 1234.57
?>
Источник:
http://php.net/manual/en/function.number-format.php
Ура!