• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 857
  • Last Modified:

delete from mysql table

i need to delete from mysql table (list_mandant) all records that do not match in the second table (where the zmsd2 is not in the listmain table)

DELETE * FROM `list_mandant`
LEFT JOIN listmain ON listmain.mandantnu = list_mandant.zmsd2
WHERE listmain.mandantnu IS NULL

Somehow this is not working.
0
michael789
Asked:
michael789
  • 3
  • 2
1 Solution
 
cfEngineersCommented:
try removing the *

0
 
michael789Author Commented:
did....same. gives me an error
0
 
michael789Author Commented:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM `list_mandant`
LEFT JOIN listmain ON listmain.mandantnu = list_mandant.' at line 1
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
cfEngineersCommented:
Here are some examples that might help
http://forums.mysql.com/read.php?6,156225,156271
0
 
michael789Author Commented:
tried that..it is running the query but does not delete anything. If I run the query with SELECT it find 3000 records...??
0
 
Brijesh ChauhanStaff IT EngineerCommented:
DELETE list_mandant.* FROM `list_mandant`
LEFT JOIN `listmain` ON listmain.mandantnu = list_mandant.zmsd2
AND listmain.mandantnu IS NULL
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now