Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello, my problem is as follows: I

Status
Not open for further replies.

halvar

Programmer
Mar 26, 2002
14
DE
Hello,
my problem is as follows: I'd like to delete all those data records of a certain table(let's call it Table A) where the email field has the identical entry as the email field of another table (let's call it Table B). I've finished the first step already, which is to seperate all records with identical email adresses. But I'm stuck when it comes to deleting those records off Table A. Does anybody know a nice Syntax from there? Thanks,
Michael
 
delete from a where a.email in (select email from b)
 
thanks for the hint but mysql is not accepting 'in' in this case. Also I tried :

DELETE a.* FROM a, b where a.email = b.email

but this does not work either. What else could one try? [bigears]
 
CREATE TEMPORARY TABLE zzz (id INT );
INSERT INTO zzz SELECT a.id FROM a,b WHERE a.email=b.email
DELETE FROM a WHERE a.id=zzz.id
DROP TABLE zzz
 
Sorry, still a problem with the delete command:

DELETE FROM a WHERE a.id=zzz.id (does not know the zzz.id)[sadeyes]

maybe you have another idea - thanks



 
Hi Gheist,
Thanks for your patience but sorry, still would not do it. [ponder]
 
this time
MySQL said:


'You have an error in your SQL syntax near 'select id from zzz)' at line 1'

quite a tricky one, this is [neutral]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top