Skip to content

Instantly share code, notes, and snippets.

@00krishna
Created February 23, 2014 01:42
Show Gist options
  • Save 00krishna/9165405 to your computer and use it in GitHub Desktop.
Save 00krishna/9165405 to your computer and use it in GitHub Desktop.
Postgresql: if you are trying to convert a string to an integer, be careful of nulls. Here is a postgres solution.
SELECT
NULLIF(your_value, '')::int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment