Thank you. That works for the simple example I had.
However, I have an additional question about this. What if I need to do
a LEFT OUTER JOIN in the Fromlist. For example, this query works but it
requires the orders table to appear twice.
UPDATE orders set requireddate =
(case when c.city in
Mark Dexter wrote:
update orders set RequiredDate =
(case when c.city in ('Seattle','Portland') then date(o.OrderDate) + 1
else date(o.OrderDate) + 2 end)
from orders o
join customers c on
o.Customerid = c.Customerid
where c.region in ('WA','OR')
and orders.orderid = o.orderid
The only diffe
Title: Complex Update Queries with Fromlist
In Microsoft SQL Server, I can write an UPDATE query as follows:
update orders set RequiredDate =
(case when c.City IN ('Seattle','Portland') then o.OrderDate + 2 else o.OrderDate + 1 end)
from orders o
join customers c on
o.Customerid = c.C