Formating numbers to two decimal spaces

From SQLZOO
Revision as of 14:47, 17 July 2012 by Connor (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Formatting numbers to two decimal places.

schema:gisq

This rounds up or down

 
 
SELECT title, score,
        FORMAT(score,'.00')
  FROM movie
  WHERE id <= 10
SELECT name,
   population,
   ROUND(population/1000000,2),
   ROUND(population,-6)
  FROM bbc
  WHERE region='North America'
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense