But who wants to remember those facts?
If we need to do either of these conversions in the database, we can simply use the KM2MILES function to convert kilometers to miles and the MILES2KM function to convert miles to kilometers!
Examples:
Code: Select all
cognos=> SELECT KM2MILES(300),
cognos-> MILES2KM(186.4113576712);
KM2MILES | MILES2KM
----------------+----------
186.4113576712 | 300
(1 row)
Code: Select all
dbadmin=> SELECT MILES2KM(70) "PA Turnpike Speed Limit (Km)",
dbadmin-> KM2MILES(8850) "Great Wall of China Length (Miles)",
dbadmin-> KM2MILES(4.5061632) "Pacific Ocean Average Depth (Miles)";
PA Turnpike Speed Limit (Km) | Great Wall of China Length (Miles) | Pacific Ocean Average Depth (Miles)
------------------------------+------------------------------------+-------------------------------------
112.65408 | 5499.13505130041 | 2.8
(1 row)