Created
August 14, 2009 08:28
-
-
Save pcdinh/167717 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
UPDATE documents | |
SET doc_code = REGEXP_REPLACE(doc_code, '.Q[[:digit:]]{1}.', | |
(CASE | |
WHEN REGEXP_LIKE(doc_code, '.(E|L).(10|11|12){1}.') THEN '.4.' | |
WHEN REGEXP_LIKE(doc_code, '.(E|L).0(7|8|9){1}.') THEN '.3.' | |
WHEN REGEXP_LIKE(doc_code, '.(E|L).0(4|5|6){1}.') THEN '.2.' | |
WHEN REGEXP_LIKE(doc_code, '.(E|L).0(1|2|3){1}.') THEN '.1.' | |
END )) | |
WHERE REGEXP_LIKE(doc_code, '.Q[[:digit:]]{1}.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment