![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 difference being that I need to add the join at the end to join the orders table in the update statement with the "orders o" table in the fromlist. |
|
First, does this look correct? It appears to work the way I want. Second, it would be really nice if there was better documentation of the UPDATE statement in Postgres, including examples of this type. |
#3
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |