一表travel_line,里面有pub_price, trade_price两字段,类型为varchar,需要把里面为纯数字的内容提取出来,写个函数来处理:
create or replace function Isnumber(P_column in varchar2) return number is l_t number; begin l_t := to_number(P_column); return 1; exception when others then return 0; end;
使用
select t.pub_price, t.trade_price, t.* from travel_line t where Isnumber(t.pub_price) = 1 and Isnumber(t.trade_price) = 1