Microsoft
Software
Hardware
Network
Question : aggregate in the set list of an UPDATE statement.
Hello, I get the following error with my statement below:
An aggregate may not appear in the set list of an UPDATE statement.
How can I fix the statement?
Update a
set LastComment = MAX(b.created)
from ReviewComments b
INNER JOIN #Temp a
ON a.[ReviewId] = b.[ReviewId]
Answer : aggregate in the set list of an UPDATE statement.
This should do:
Update a
set LastComment = b.created
from #Temp a
INNER JOIN ( SELECT [ReviewId], MAX(created) created FROM ReviewComments
GROUP BY [ReviewId]) b
ON a.[ReviewId] = b.[ReviewId]
Random Solutions
Why is the Remote Install Tab not showing up in the active directory after I install RIS on a server?
MVVM WPF: Binding Problems
SQL Sorting Issue
Trigger for INSERT, UPDATE, DELETE - determine which event happened within the trigger?
Expr field in VFp9.0 report designer
How Can I forward email from a mailbox to a distribution list in exchange 2003 using a forwarder?
SSIS insert primary key - there must be a way
VFP dynamic inputmask
Run a PowerPoint Tutorial Before User Log In
Hyperlinked InfoPath Form within SharePoint