0

This is working:

select *  FROM Work_Request A where EXISTS  ( select 1  from Customer B where (B.lsource&128)!=0 and B.license_id=A.license_id) ;

As per Delete all rows in a table based on another table this delete should also work but instead giving error:

delete  FROM Work_Request A where EXISTS  ( select 1  from Customer B where (B.lsource&128)!=0 and B.license_id=A.license_id) ;

Error:

ERROR 1064 (42000): 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 'A where EXISTS ..

...

Community
  • 1
  • 1
user5858
  • 1,082
  • 4
  • 39
  • 79

1 Answers1

0

your delete statement should be like this

delete  A.* FROM Work_Request A 
where EXISTS  ( select 1  from Customer B where (B.lsource&128)!=0 and B.license_id=A.license_id) ;

you are missing name of table thats gonna delete ...have fun :-)

Ankit Agrawal
  • 2,426
  • 1
  • 13
  • 27