update a set a.P = isnull( ( select top 1 P from B b where a.I >= b.SI and a.I <= b.EI order by (b.EI-b.SI) ),'') , a.C = isnull( ( select top 1 C from B b where a.I >= b.SI and a.I <= b.EI order by (b.EI-b.SI) ),'') from A a ¸üÐÂÓï¾äorder by ¾Í²»ÒªÁË.. B.PºÍB.CµÄĬÈÏÖµÓÉNULL¸Ä³É'',ÕâÑù¾ÍÊ¡ÅжÏÁË ²»Óà order by ²»Äܱ£Ö¤Êý¾Ý˳Ðò Null ÊÇûÓÐÕÒµ½µÄʱºò ĬÈÏÉèÖà Êý¾Ý¿âÉè¼Æ´æÔÚÎÊÌâ¡£ û°ì·¨ÓÅ»¯ÁËÂð? sql2000 µÄÊý¾Ý¿â SQL code: update A set A.P = isnull( c.P,'') , A.C = isnull( c.C,'') from B where A.I >= B.SI and A.I <= B.EI and (B.EI - B.SI) = min(B.EI - B.SI)