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
Set up ISAPI module on IIS7
I am trying to add an edit, delete function to an existing gridview
Range.Copy() causes a -2146827284 COMException
Populate a combo box based on selection from previous combo box
MSCom1 control returns objectrequired - what am I doing wrong?
Add New REG_DWORD type Hexadecimal base Key in Registry using VB6
UML Reverse Engineer Visual Studio 2008 and Visio 2007
Blue Screen
Excel Question
IRR function - project with all negative periods