亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    oracle怎么查詢不包含指定字符

    方法:1、利用“select * from 表名 where order_no not like 字符”語句查詢;2、利用“select * from 表名 where not regexp_like(order_no,字符)”語句查詢。

    oracle怎么查詢不包含指定字符

    本教程操作環(huán)境:Windows10系統(tǒng)、Oracle 11g版、Dell G3電腦。

    oracle怎么查詢不包含指定字符

    開發(fā)過程中遇到個需求,用戶要提取的數(shù)據(jù)列中不包含 YF、ZF、JD的字符串,

    方法1:

    select * from table  where  order_no not like '%YF%' and order_no not like '%ZF' and order_no not like '%JD%'

    感 覺方法1有點笨,想到REGEXP_LIKE 可以實現(xiàn)包含多個,在前面加上 not 就可以實現(xiàn)不包含功能,方法如下:

    方法2:

    select * from table where not regexp_like(order_no,'YF|ZF|JD')

    兩種方法都可以實現(xiàn),但效率問題,經(jīng)查詢兩個月11萬條數(shù)據(jù)做比效方法1用時18秒,方法2用時15秒,連續(xù)測試三次方法1總是比方法快2至3秒,如果數(shù)據(jù)量大的還是建議使用方法1!

    推薦教程:《Oracle視頻教程》

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號