Skip to content

Instantly share code, notes, and snippets.

@donatj
Created January 18, 2011 22:59
Show Gist options
  • Save donatj/785335 to your computer and use it in GitHub Desktop.
Save donatj/785335 to your computer and use it in GitHub Desktop.
Useful MySQL Expressions
CONCAT(IF(ASCII(LEFT(products_model,1))>57,LEFT(products_model,1),'0'),IF(ASCII(RIGHT(products_model,1))>57,LPAD(products_model,10,'0'),LPAD(CONCAT(products_model,'-'), 10,'0')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment