这真的开始受伤了!
我正在尝试使用正则表达式条件在Oracle开发人员中编写查询
我的目标是找到所有不包含在名称中的字符(非字母,空格,连字符和单引号)
即我需要找到
J00ls
McDonald "Macca"
Smithy (Smith)
Run Code Online (Sandbox Code Playgroud)
并没有找到
Smith
Mckenzie-Smith
El Hassan
O'Dowd
Run Code Online (Sandbox Code Playgroud)
我目前的查询是
select * from dm_name
WHERE regexp_like(last_name, '([^A-Za-z -])')
and batch_id = 'ATEST';
Run Code Online (Sandbox Code Playgroud)
其中排除了除单引号之外的所有预期内容。当涉及到单引号字符时,Oracvel SQL Develoepr解析器将其用作文字。
我试过了:
\' -- but got a "missing right parenthesis" error
||chr(39)|| -- but the search returned nothing
'' -- negated the previous character in the matching group e.g. '([^A-Za-z -''])' made names with '-' return.
Run Code Online (Sandbox Code Playgroud)
我会很感激你能提供的任何东西。
我正试图
select columns Age, Height, House_number, Street
from my_table
where count(combination of House_number, Street)
occurs more than once.
Run Code Online (Sandbox Code Playgroud)
我的桌子看起来像这样
Age, Height, House_number, Street
15 178 6 Mc Gill Crst
85 166 6 Mc Gill Crst
85 166 195 Mc Gill Crst
18 151 99 Moon Street
52 189 14a Grimm Lane
Run Code Online (Sandbox Code Playgroud)
我期望的结果看起来像这样
Age, Height, House_number, Street
15 178 6 Mc Gill Crst
85 166 6 Mc Gill Crst
Run Code Online (Sandbox Code Playgroud)
卡住!