Reputation: 11
In microsoft access:
Update Orders
Set TotalPrice = (SELECT Max(Total)
FROM OrderDetails)
Can anyone please explain me why this doesn't work?
Upvotes: 1
Views: 415
Reputation: 123484
Your query fails with "Operation must use an updateable query" because the Access Database Engine tends to make queries "not updateable" if they use certain features like SQL aggregation functions (e.g., MAX()
), outer joins, etc..
In your particular case the equivalent query for Access would use the DMax()
domain aggregate function:
UPDATE Orders SET TotalPrice = DMax("Total", "OrderDetails")
Upvotes: 1