oracle查詢不含括號及不含指定字元的方法

2022-09-24 14:18:13 字數 685 閱讀 5278

oracle查詢不含括號不含指定字元的記錄方法如下:

with tmp_t as(

select 1 as id,'測試4321_cs' as name from dual union all

select 2,'測試 1200(測試版)' from dual union all

select 3,'測試123(測試版)' from dual union all

select 4,'測試 1212(d2)' from dual union all

select 5,'測試 1212(d2)測試版' from dual union all

select 6,'測試 1epddwcqvou23' from dual)

select *

from tmp_t

where instr(name, '_cs') = 0

and regexp_instr(name, '(.*)') = 0

and regexp_in程式設計客棧str(name, '\(.*\)') = 0

結果為:

其中regexp_instr為oracle支援的正規表示式函式,其功能與instr相似。此處匹配了含有括號()和()的記錄。

本文標題: oracle查詢不含括號及不含指定字元的方法

本文位址: /shujuku/oracle/110408.html

mysql查詢欄位中不含中文的資料

我查到最多的是where條件後面 length name character length name 或者說length name character length name 是舊式的不等於的寫法,現在一般都使用 了 所以我們還是使用 吧。他的原理就是利用中文的長度和他的字元長度不一致,來查詢的。一...

SQL語句查詢欄位中不含有漢字的條目

sql語句模糊查詢,使用like,其後加上sql裡的萬用字元即可。1 like mc 將搜尋以字母 mc 開頭的所有字串 如 mcbadden 2 like inger 將搜尋以字母 inger 結尾的所有字串 如 ringer stringer 3 like en 將搜尋在任何位置包含字母 en ...

oracle 基本查詢語句及例項

1 查詢所有列 select from 表名 2 查詢表結構 desc 表名 3 查詢指定列 select ename,sal,job from 表名 4 oracle中檢視所有表和字段 獲取表 select table name from user tables 當前使用者的表 select ta...