Skip to content

Instantly share code, notes, and snippets.

@phpdave
Created April 7, 2015 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpdave/830dac112ff4ccb8f4a1 to your computer and use it in GitHub Desktop.
Save phpdave/830dac112ff4ccb8f4a1 to your computer and use it in GitHub Desktop.
SELECT *
FROM MYTABLE
WHERE TRANSLATE (MYTABLE.MYFIELD, 'NNNNNNNNNNX', '1234567890N') = 'NNNNN' AND MYTABLE.MYFIELD<10000
--MYFIELD is a CHAR(5) field and is being compared against 5 'N's
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment