MySQL format numbers with comma How can I print the integer part of a number with commas separating every three digits?

For example, 

 12345    -&gt; 12,345
 1234.567 -&gt; 1,234.567
Use the FORMAT function, which works for floating point numbers as well as for integers:

Floating point numbers:

mysql&gt; SELECT FORMAT(12332.123456, 4);
        -&gt; '12,332.1235'
mysql&gt; SELECT FORMAT(12332.1,4);
        -&gt; '12,332.1000'
mysql&gt; SELECT FORMAT(12332.2,0);
        -&gt; '12,332'


Integers:

mysql&gt; SELECT FORMAT(12334, 0);
        -&gt; 12,334