Question
SQL: Updating via joins
I need to update some records in a table based on a query
using two joins.
The specific records I need to delete are determined via the query:
SELECT WeFAQs.collectionID, WeFAQs.question, WeFAQs.categoryID,
WeFAQs.publicAccess, WeFAQs.sort
FROM WeFAQs LEFT OUTER JOIN
We_about_categories CAT ON CAT.categoryID =
WeFAQs.categoryID LEFT OUTER JOIN
We_about_categories PARENTCAT ON PARENTCAT.categoryID
= CAT.categoryParentID
WHERE (WeFAQs.categoryID = 9) OR
(categoryParentID = 9)
I only need to update the 5 fields selected in the WeFAQs table.
So, my question...can I do this with a SELECT INTO or an UPDATE command? The
syntax is eluding me.
Or is this a prime example of where a temp table is useful?
-Darrel
The specific records I need to delete are determined via the query:
SELECT WeFAQs.collectionID, WeFAQs.question, WeFAQs.categoryID,
WeFAQs.publicAccess, WeFAQs.sort
FROM WeFAQs LEFT OUTER JOIN
We_about_categories CAT ON CAT.categoryID =
WeFAQs.categoryID LEFT OUTER JOIN
We_about_categories PARENTCAT ON PARENTCAT.categoryID
= CAT.categoryParentID
WHERE (WeFAQs.categoryID = 9) OR
(categoryParentID = 9)
I only need to update the 5 fields selected in the WeFAQs table.
So, my question...can I do this with a SELECT INTO or an UPDATE command? The
syntax is eluding me.
Or is this a prime example of where a temp table is useful?
-Darrel
