I'm trying to do a decode on the LOCATION_ID field of one of our tables. The location_id is preceeded by a character that tells us what line that station is on. For example, BAIR, is Airport on the Blue Line. RALE is Alewife on the Red Line and so on. I am trying to write a decode function to read-in the location_id, determine what the first character is of that string and then return the line value. Ie. 'R' found in RALE would return 'Red Line'. So, what is the wild card character to pull out chars but you only care what the first one is. Well, I'm trying to do something like this where the # sign is the wildcard.
Thanks,
Todd
Code:
DECODE(a.LOCATION_ID, 'R#', 'Red Line', 'O#', 'Orange Line', 'B#', 'Blue Line', 'G#', 'Green Line', 'S#', 'Silver Line') AS LINE
Thanks,
Todd