1

Below query is giving error: Incorrect syntex near group.

Please help

UPDATE patient 
SET CreationDateTime = MIN(doc.creationdatetime)
FROM Patient patient 
INNER JOIN Document doc ON patient.patientid = doc.patientid
GROUP BY patient.patientid
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Vatan Soni
  • 540
  • 2
  • 11
  • 23
  • Not really what you are trying to do here. Are you trying to update each patients CreatingDateTime with the earliest creationdatetime from the Document table? – Sean Lange Oct 11 '18 at 15:11

0 Answers0