-- 查询表中的重复数据 SELECT * FROM Dict_FeeItem where feeitemcode='F512' SELECT * FROM Dict_ReportItem WHERE fid=4 update Dict_ReportItem SET RptItemCode=NULL select TOP 20 * FROM Exam_Result select DISTINCT RID FROM Exam_Result A WHERE NOT EXISTS (SELECT 1 FROM Dict_ReportItem B WHERE B.ID=A.RID) FID SELECT TOP 20 * FROM PEIS.DBO.FeeItem WHERE ID IN (363, 461,472,96,154,279,471) update Exam_Result set fid=470 where fid in (471,472,154) update Exam_Result set fid=1 where fid =461 update Exam_Result set fid=558 where fid in (96 ) SELECT * FROM vi_EnPart WHERE EID=1252 AND FID=3 select * from Exam_Part where eid=1252 select * from Exam_Result where pid=57 UPDATE Exam_Result SET rID=b.ID FROM Exam_Result a left join Dict_ReportItem b ON A.fID=B.FID and a.RptItemName=b.RptItemName update [BaogaoInfo] set YangbenGuid =b.Guid from BaogaoInfo a left join YangbenInfo b on a.YangbenId = b.Id select * from Dict_ReportItem where id=4