标签:back 表数据 class com 写法 .com 复数 alt src
1.环境准备
CREATE TABLE DataInfo( ID_1 VARCHAR(10), ID_2 VARCHAR(10) ) INSERT INTO DataInfo VALUES(‘A‘,‘Oracle‘); INSERT INTO DataInfo VALUES(‘B‘,‘sqlserver‘); INSERT INTO DataInfo VALUES(‘C‘,‘DB2‘); INSERT INTO DataInfo VALUES(‘DB2‘,‘C‘); INSERT INTO DataInfo VALUES(‘Oracle‘,‘A‘); INSERT INTO DataInfo VALUES(‘sqlserver‘,‘B‘);
图表数据展示:
ID_1 | ID_2 |
A |
Oracle |
B |
sqlserver |
C |
DB2 |
DB2 |
C |
Oracle |
A |
sqlserver |
B |
现在判定A,ORACLE与ORACLE,A这种数据为重复数据。
--删除重复数据 DELETE FROM DataInfo A WHERE EXISTS (SELECT 1 FROM DataInfo B WHERE A.ID_1=B.ID_2 AND A.ID_2=B.ID_1) AND A.ID_1>A.ID_2 ORDER BY ID_2
标签:back 表数据 class com 写法 .com 复数 alt src
原文地址:http://www.cnblogs.com/OliverQin/p/6644438.html