After a recent upgrade to 10g, a query that used to work is failing....
I'm attempting to run the following query:
SELECT DISTINCT id3, id1, id2
SELECT SUBSTR (stvrdef_code, 1, 1) id1,
SUBSTR (stvrdef_code, 2, 1) id2,
SUBSTR (stvrdef_code, 1, 2) id3
WHERE f_valid_number(SUBSTR (stvrdef_code, 1, 1)) = 'Y'
WHERE id1 BETWEEN 8 AND 9
ORDER BY id1, id2
Some sample data from the stvrdef table:
AC Air conditioning
ADA ADA-Wheelchair Accessible
CCM1 Computer Classroom-multi-units
Ok, obviously Oracle is choosing to look at the STVRDEF table prior to filtering out only cases where the first character of the CODE is numeric. But, I've tried rearraning this statement in many ways and am having no success.
Points to the first one with a working SQL statement that does what I need.