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
Fortigate as a mail relay/reverse proxy/ISA?
Internet Explorer Log File 200Gb - Disk full
How do I setup a network with cross over cable between server 2008 and server 2003? 500pnts
Have the report showing correctly, now what?
GPO Package error
Outlook closes as soon as it starts
Zend_Mail without Zend framework ?
Attach txt file with sendmail
Installing 'Compatibility Files' in Vista and Windows 7
Format an amount without the decimal point