0

I understand you can delete from multiple tables using joins. But, I'm not sure how to do that. I tried using this statement and it didn't work either.

delete trm, val 
from MCS.stg_mdcr_trmntn_rpt trm, MCS.stg_mdcr_vldtn_rpt val
where trm.import_proc_id = 156;
4
  • on what column do you want to join? Commented Jul 3, 2013 at 15:16
  • 2
    What RDBMS are you using? MySQL supports a multi table delete but SQL Server doesn't for example. Commented Jul 3, 2013 at 15:16
  • 2
    you can't delete fields like that... cause I suppose trm and val are fields right ? Commented Jul 3, 2013 at 15:17
  • 1
    It almost looks like its not a field, but rather an alias... Commented Jul 3, 2013 at 15:19

1 Answer 1

1

What's wrong with

delete from MCS.stg_mdcr_trmntn_rpt 
where import_proc_id = 156;

delete from MCS.stg_mdcr_vldtn_rpt
where import_proc_id = 156;

commit;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.