2

我在下拉列表中填充所有用户名。我想忽略包含任何这些#, \, /, uppercase,的用户名$。我正在执行此查询,但它仍然显示带有 的记录\,例如 ad\name。

select account_name from dba_account where CAST(account_name  AS BINARY) RLIKE '[a-z]' 
and account_name not like '%#%' and account_name not like '%$%' and account_name not like 
'%/%' limit 50;

有什么建议么????

谢谢你...

4

2 回答 2

2
SELECT
  account_name 
FROM
  dba_account 
WHERE 
  CAST(account_name  AS BINARY) RLIKE '[a-z]' 
  AND account_name NOT RLIKE '[#$\\\\/]'
LIMIT 50;
于 2012-07-30T16:04:36.180 回答
0

您的查询

select account_name from dba_account where CAST(account_name  AS BINARY) RLIKE '[a-z]' and account_name not like '%#%' and account_name not like '%$%' and account_name not like '%/%' limit 50;

不包含排除反斜杠的逻辑。

于 2012-07-30T16:03:43.837 回答