Created
May 1, 2009 21:28
-
-
Save ddeaguiar/105271 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
select | |
CASE | |
WHEN (REGEXP_SUBSTR(category, '(a[[:alnum:]]|sa)', 1, 1, 'i') is not null) THEN 'SUITE' | |
WHEN (REGEXP_SUBSTR(category, '(d[[:digit:]]|sd)', 1, 1, 'i') is not null) THEN 'DELUXE_BALCONY' | |
WHEN (REGEXP_SUBSTR(category, '(b[[:alnum:]]|sb)', 1, 1, 'i') is not null) THEN 'BALCONY' | |
WHEN (REGEXP_SUBSTR(category, '(c|d|e|f|g|h)[[:alnum:]]?', 1, 1, 'i') is not null) THEN 'OCEANVIEW' | |
ELSE 'INTERIOR' | |
END AS META | |
from foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment