希望用oracle语句,查询出m.mchntname此字段中包含数字的数据,不知道怎么处理?
谢谢帮忙!!! select m.mchntid, p.priceid,  m.mchntname,  p.tradeno, p.cardPrice, p.priceEffect,      p.cardvalue,                                       
 s.statusname ,cp.cardname,p.pricetag  
 from m_price p, m_cardtype cp, m_merchant m,m_status s 
 where p.cardtype = cp.cardtype and p.mchntid = m.mchntid and p.pricetag = s.statusid 
 and p.pricetag <> '02'                         
  order by  cp.cardname

解决方案 »

  1.   


    这个就是我的sql语句,希望在增加只查询名字中包含数字的条件
      

  2.   

    select m.mchntid, p.priceid, m.mchntname, p.tradeno, p.cardPrice, p.priceEffect, p.cardvalue,   
     s.statusname ,cp.cardname,p.pricetag   
     from m_price p, m_cardtype cp, m_merchant m,m_status s  
     where p.cardtype = cp.cardtype and p.mchntid = m.mchntid and p.pricetag = s.statusid  and p.pricetag <> '02'   and regpxp_lkike(m.mchntname,'[[:digit:]]')
      

  3.   


    select m.mchntid, p.priceid, m.mchntname, p.tradeno, p.cardPrice, p.priceEffect, p.cardvalue,   
     s.statusname ,cp.cardname,p.pricetag   
     from m_price p, m_cardtype cp, m_merchant m,m_status s   
     where p.cardtype = cp.cardtype and p.mchntid = m.mchntid and p.pricetag = s.statusid and p.pricetag <> '02' and regpxp_like(m.mchntname,'[[:digit:]]')--or
    and regpxp_instr(m.mchntname,'[[:digit:]]',1)>0
      

  4.   


    ---前面键盘输入错误
    select m.mchntid, p.priceid, m.mchntname, p.tradeno, p.cardPrice, p.priceEffect, p.cardvalue,   
     s.statusname ,cp.cardname,p.pricetag   
     from m_price p, m_cardtype cp, m_merchant m,m_status s   
     where p.cardtype = cp.cardtype and p.mchntid = m.mchntid and p.pricetag = s.statusid and p.pricetag <> '02' and regexp_like(m.mchntname,'[[:digit:]]')--or
    and regexp_instr(m.mchntname,'[[:digit:]]',1)>0
      

  5.   

    and m.mchntname LIKE '[0~9]{1,}'