先启数据库服务,再启manager服务。
否则重建档案资料库
再否则把ORACLEHOME\NETWORK\sqlnet.ora文件的内容
sqlnet.authentication_services=(NTS)
改成sqlnet.authentication_services=(NONE)
否则重建档案资料库
再否则把ORACLEHOME\NETWORK\sqlnet.ora文件的内容
sqlnet.authentication_services=(NTS)
改成sqlnet.authentication_services=(NONE)
select user_id,name,count(user_id),count(name) from table
group by user_id,name having count(user_id)>1 or count(name)>1;顺便问问你的目的是什么?
http://www.oradb.net/sql/find0.htm
这么写是最简单的也是最快的。
select rowid,user_id,name from table a
where a.rowid!=(select max(rowid) from table b
where a.user_id=b.user_id and a.name=b.name);
不为数字的比较麻烦,可能需要自己写函数或过程来处理
当然也可以做函数或过程来实现,但是不符合贴主要求在1个sql语句的解决的要求。
贴主可以试试这个:
where translate(user_id,'x1234567890','x') is not null;
这样就可以了。
select user_id,name
from table
where
(user_id in (select max(user_id) from table group by user_id having count(*)>=2))
or
(name in (select max(name) from table group by name having count(*)>=2))
order by user_id
这个我发现执行效率比较低,是否有能够实现同样功能的sql
select rowid,user_id,name from a where length(a.user_id)!=15 or length(a.user_id)!=18 or a.rowid!=(select max(rowid) from a b where a.id=b.id or a.name=b.name);
请问我上面写得是否正确,含义应该是,选出当前数据库中所有user_id或者name重复的记录,以及user_id(身份证号)不正确的记录.
请问对吗?再次请指教.