Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MYSQL select to convert numbers to million,billions format

i have simple mysql query

select count(total_profit)as profit from sales_profits

i get some thing like this as result profit=25000000000. What i want is some like this profit=25,000,000,000, is there some way by which we can do it in MYSQL?

like image 359
noobie-php Avatar asked Dec 20 '22 19:12

noobie-php


1 Answers

Try with

SELECT FORMAT(COUNT(total_profit), 0) AS profit 
FROM sales_profits
like image 186
sarwar026 Avatar answered Jan 13 '23 22:01

sarwar026