Multi-Table Delete?

  • Thread starter Thread starter JohnnyC
  • Start date Start date
J

JohnnyC

DELETE questions.question, answers.answer
FROM questions LEFT JOIN answers ON
questions.id=answers.questionId
WHERE questions.id=2;

I want to delete a question and answer pair even if a
question has not been answered yet. When I try to test
this in Access, it tells me that I need to select a
table. I thought I had. Any suggestions?
 
The easiest way to do this would be to set referential integrity between the
tables with cascade delete. Then you would only need to delete from the
question table...answers would be deleted automatically.
 
Thanks!
-----Original Message-----
The easiest way to do this would be to set referential integrity between the
tables with cascade delete. Then you would only need to delete from the
question table...answers would be deleted automatically.

--
Paul Overway
Logico Solutions, LLC
www.logico-solutions.com





.
 
Back
Top