Created
September 30, 2014 13:34
-
-
Save dramaturg/356fe6d33f14936c7d97 to your computer and use it in GitHub Desktop.
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
-- Helper function to do whitespace cleanup | |
DELIMITER $$ | |
CREATE FUNCTION ugly_trim(s VARCHAR(1000)) | |
RETURNS VARCHAR(1000) | |
DETERMINISTIC | |
BEGIN | |
DECLARE temp VARCHAR(1000); | |
SET temp = ''; | |
SET temp = | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
REPLACE(s | |
, ' ', ' ') | |
, ' ', ' ') | |
, ' ', ' ') | |
, ' ', ' ') | |
, ' ', ' ') | |
, ' ', ' ') | |
, ' ', ' ') | |
, ' ', ' ') | |
, ' ', ' '); | |
RETURN temp; | |
END$$ | |
DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment