Created
June 3, 2020 06:49
-
-
Save seifip/a0207e7e94b6cc42fe6761018cef4a62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- total_price | quantity | |
-- ::money | ::integer | |
-- ---------------------------- | |
-- $3.50 | 4 | |
SELECT price::numeric / quantity FROM items; | |
-- $0.87 | |
SELECT price::numeric / quantity; | |
-- 0.87500000000000000000 | |
SELECT (price::numeric / quantity)::money; | |
-- $0.88 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment