In oracle, intersect will work for you better than minus. as it shows data from both tables which doesn't exist in another one.
anyway in mysql, you can try this: select A.* from A left join B on (f1, f2, f3, f4) where B.f1 is null and B.f2 is null and B.f3 is null and B.f4 is null; hope it helps Nitin ----- Original Message ----- From: "fab" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, November 04, 2003 1:58 PM Subject: minus operation > Hi to all, > > My question is rather about sql langage than mysql. > > Here it is: i have 2 tables (A and B) with the same structure (4 fields > called f1,f2,f3,f4). > Table A counts x records and table B counts y records (and x <> y). > Then, table A has records that do not belong to table B and table B has > records that do not belong to table A. > > My question is: how to get the records that belongs to A and not to B > and the records that belongs to B and not to A. > > If i was using oracle, i guess i could use the minus sql command. More > over, i don't think i can use a simple left join because i have to > verify the 4 fields and not only the first one. > > If anyone could answer, it would be great. Actualy, i lost lots of > records and i try to rebuild my table with the help of the savings of > this table. > > f. > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]