Display two digits after decimal point in SQL from average value This is my code

SELECT  AVG(`page_rate` )
FROM `pages` 
   INNER JOIN `languages` ON `pages`.`lang_id`=`languages`.`id` 
WHERE `abbr` IN ("EN-UK", "EN-US", "EN-AU")


How can I display only 2 digits after decimal point?

I tried this:

SELECT AVG( cast(`page_rate` as decimal(10,2))) 
FROM `pages` 
    INNER JOIN `languages` ON `pages`.`lang_id`=`languages`.`id` 
WHERE `abbr` IN ("EN-UK", "EN-US", "EN-AU")


but result is 20.166667 - not only 2 digits
Switch your AVG and CAST. Instead of

SELECT AVG( cast(`page_rate` as decimal(10,2)))


Use

SELECT CAST(AVG(`page_rate`) as decimal(10,2))


Then you are casting your average with 2 decimal places.