Delete rows from one tbl based on whether row in another tbl?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • weeodett
    New Member
    • Jan 2007
    • 8

    Delete rows from one tbl based on whether row in another tbl?

    How can I delete about 9000 rows from one table (Table1) based on whether they also are in another table (Table2)? I tried the following:

    DELETE FROM Table1 T
    WHERE T.DocNo = Table2.DocNo
    and T.DocTyp = Table2.DocTyp
    and T.DocLn = Table2.DocLn
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    [PHP]DELETE FROM Table1
    FROM Table1 T, Tabele2
    WHERE T.DocNo = Table2.DocNo
    and T.DocTyp = Table2.DocTyp
    and T.DocLn = Table2.DocLn[/PHP]

    Comment

    • weeodett
      New Member
      • Jan 2007
      • 8

      #3
      Thank you very much!!

      Comment

      Working...