Skip to content

Instantly share code, notes, and snippets.

@brunotdantas
Created November 5, 2019 17:52
Show Gist options
  • Save brunotdantas/91fbf8fd41d0bd72d70dd62d09031f88 to your computer and use it in GitHub Desktop.
Save brunotdantas/91fbf8fd41d0bd72d70dd62d09031f88 to your computer and use it in GitHub Desktop.
--https://stackoverflow.com/questions/662383/better-techniques-for-trimming-leading-zeros-in-sql-server/662437#662437
SELECT SUBSTRING(IDCLIENTE, PATINDEX('%[^0]%', IDCLIENTE+'.'), LEN(IDCLIENTE)) ,* FROM TB_IN_SAP_CUSTOMER WHERE CNPJ IN ( 'zzzzzz')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment