0

Suppose I have two table. One is Car_Window and another is Product. Now I want to write a delete statement that should delete all data from Product

Where the Car_Window.Id = Product.Makeid and Car_Window.Year = Product.Year and Car_Window.Model != product.Model

Any help would be appreciated.

Thanks in Advance.

2
  • You need to explain this better, delete ALL data from Product is just: DELETE FROM Product Commented Feb 18, 2013 at 9:30
  • What RDBMS you are using? SQL Server? MySQL? Oracle? DB2? etc.. Commented Feb 18, 2013 at 9:30

1 Answer 1

1
DELETE  a
FROM    product a
        INNER JOIN car_window b
            ON a.makeID = b.ID AND
                a.Year = b.year
WHERE   b.Model != a.Model
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.