Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Need to DELETE records from JOIN statement from both tables

$
0
0
Hello, I can't figure out how to delete records from both tables that are joined. The results I need to delete are based on the WHERE clause that returns the data. My delete statement is only deleting from the ae_job table and I need the records to also delete from the ae_jobel table.SELECT distinct appid, ae_jobel.docid, ae_job.jid, ae_job.jstatfrom ae_job join ae_jobelON (ae_job.jid = ae_jobel.jid)where appid = '180'DELETE apfrom ae_job as ap INNER JOIN ae_jobel as elON ap.jid = el.jidWHERE LOWER(el.appid) LIKE '%180%'

Viewing all articles
Browse latest Browse all 3145

Trending Articles