Last active
June 26, 2018 03:36
-
-
Save abelcallejo/dab61f4fceeab25ef9bcb4788d262851 to your computer and use it in GitHub Desktop.
intval
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
/** | |
* This is how you intval in PostgreSQL | |
**/ | |
SELECT cast( coalesce( nullif( column_name_here, 0 ), '0') as integer ) AS column_name_alias_here FROM table_name_here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment