update qitems set COLORS=(select distinct COLOR from qdetail where GOODSNO=qitems.GOODSNO); update qitems set UNIT2=(select distinct COLORNO from qdetail where GOODSNO=qitems.GOODSNO); update qitems set SIZES=(select distinct SIZE from qdetail where GOODSNO=qitems.GOODSNO)