【已解决】ORA-00001: unique constraint (USR_JXZX_DSJKF_MODEL.SYS_C00912833) violated

简介: 【已解决】ORA-00001: unique constraint (USR_JXZX_DSJKF_MODEL.SYS_C00912833) violated

问题

学号主键ID重复了

思路

Oracle 中,可以使用以下方法找出重复的主键:

  1. 使用 GROUP BY 和 HAVING 子句:使用 GROUP BY 子句按照主键列进行分组,并使用 HAVING 子句筛选出出现次数大于 1 的主键。
sqlSELECT primary_key_column, COUNT(*) 
FROM table_name 
GROUP BY primary_key_column 
HAVING COUNT(*) > 1;

再用 NOT IN 进行过滤

解决

执行成功


目录
相关文章
|
8月前
3.4 Using DBCA to Create a Data Guard Standby
3.4 Using DBCA to Create a Data Guard Standby
46 1
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘thinkphp.test‘ don‘t exsit
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘thinkphp.test‘ don‘t exsit
404 0
【ERROR】ERROR1: PROJ: proj_create_from_database: Cannot find proj.db
【ERROR】ERROR1: PROJ: proj_create_from_database: Cannot find proj.db
893 0
|
存储 关系型数据库 MySQL
ERROR 1215 (HY000): Cannot add foreign key constraint
ERROR 1215 (HY000): Cannot add foreign key constraint
ERROR 1215 (HY000): Cannot add foreign key constraint
|
关系型数据库 Oracle
ORACLE报错:enviroment variable ORACLE_SID not defined,please define int
版权声明:转载请注明出处:http://blog.csdn.net/dajitui2024 https://blog.csdn.net/dajitui2024/article/details/79396667 ...
1029 0
|
C++
[odb-users] Create schema error (unknown database schema '')
Boris Kolpackov boris at codesynthesis.com Fri May 31 11:13:02 EDT 2013   Previous message: [odb-users] Create schema error (unknown database schem...
1451 0
|
Oracle 关系型数据库 Linux
[20170209]db_unique_name.txt
[20170209]db_unique_name.txt --前几天测试dataguard配置缺少fal_client,fal_server,log_archive_config,db_unique_name设置,会不会出现问题: --链接: http://blog.
918 0