SELECT T1.姓名 AS 一表姓名,T1.身份证 AS 一表身份证,T1.班级 AS 一表班级,T2.姓名 AS 二表姓名,T2.身份证 AS 二表身份证,T2.班级 AS 二表班级 ; FROM 一表 AS T1, 二表 AS T2 ; WHERE (ALLTRIM(T1.姓名)==ALLTRIM(T2.姓名) AND ALLTRIM(T1.身份证)<>ALLTRIM(T2.身份证)) OR ; (ALLTRIM(T1.姓名)<>ALLTRIM(T2.姓名) AND ALLTRIM(T1.身份证)==ALLTRIM(T2.身份证)) OR ; (ALLTRIM(T1.姓名-T1.身份证)==ALLTRIM(T2.姓名-T2.身份证) AND ALLTRIM(T1.班级)<>ALLTRIM(T2.班级))
SELECT T1.姓名 AS 一表姓名,T1.身份证 AS 一表身份证,T1.班级 AS 一表班级,T2.姓名 AS 二表姓名,T2.身份证 AS 二表身份证,T2.班级 AS 二表班级 ; FROM 一表 AS T1, 二表 AS T2 ; WHERE (ALLTRIM(T1.姓名)==ALLTRIM(T2.姓名) AND ALLTRIM(T1.身份证)<>ALLTRIM(T2.身份证)) OR ; (ALLTRIM(T1.姓名)<>ALLTRIM(T2.姓名) AND ALLTRIM(T1.身份证)==ALLTRIM(T2.身份证)) OR ; (ALLTRIM(T1.姓名-T1.身份证)==ALLTRIM(T2.姓名-T2.身份证) AND ALLTRIM(T1.班级)<>ALLTRIM(T2.班级))