SELECT a.id as eid ,a.name,b.PatientNo FROM Enrollment_Patient A LEFT JOIN [dbo].[Report_GSEXD] B ON A.Name=B.Name WHERE A.SignTime>'2024-06-16' and b.id is not null SELECT * FROM Enrollment_Patient where id=80016 select * from [dbo].[Report_GSEXD] where name='亢永涛' UPDATE Report_GSEXD SET PatientNo=A.EID FROM Enrollment_FeeItem A LEFT JOIN [dbo].[Report_GSEXD] B ON A.ID=B.RecordNo WHERE A.CreateTime>'2024-06-16' and b.id is not null AND A.FeeItemName='十二通道心电图检查' AND A.EID>80000 AND B.ID=2