coping
10-08-2008, 11:26 AM
Oracle 10g
I have a table with a location field such as this:
MEX HQ/DF/MXMEX-HQ
MEM/TN/38194-7533
MIA LAC/FL/33126-0010
I want to select all the locations that contains a number. I've tried
INSERT INTO MYTABLE
SELECT location, r_num, r_dt
FROM TABLE1
WHERE location IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
WHERE location LIKE '%[0-9]%';
WHERE SUBSTR(location,20) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
I also want parse the field at the first number.
Any ideas?
I have a table with a location field such as this:
MEX HQ/DF/MXMEX-HQ
MEM/TN/38194-7533
MIA LAC/FL/33126-0010
I want to select all the locations that contains a number. I've tried
INSERT INTO MYTABLE
SELECT location, r_num, r_dt
FROM TABLE1
WHERE location IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
WHERE location LIKE '%[0-9]%';
WHERE SUBSTR(location,20) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
I also want parse the field at the first number.
Any ideas?