Created
September 10, 2012 13:24
-
-
Save audriusrudalevicius/3690880 to your computer and use it in GitHub Desktop.
mysql explode
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
if(INSTR({string_or_var}, '-'), (REPLACE( SUBSTRING( SUBSTRING_INDEX( {string_or_var}, '-', 1 ) , | |
LENGTH( SUBSTRING_INDEX( {string_or_var}, {string_or_var}, 1 -1 ) ) +1 ) , '-', '' )), '') | |
if(INSTR({string_or_var}, '-'), (REPLACE( SUBSTRING( SUBSTRING_INDEX( {string_or_var}, '-', 2 ) , | |
LENGTH( SUBSTRING_INDEX( {string_or_var}, {string_or_var}, 2 -1 ) ) +1 ) , '-', '' )), '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment