Igor, It took me a bit of looking, but I think I understand your query. One question remains: why did you use the max() function?
Thanks! RobR -----Original Message----- update adla1 set PFLOPF=( select case count(*)=1 then max(adl.pflopf) else adla1.pflopf end from adl where adla1.ref=adl.ref); This says: for each row in adla1, if adl has exactly one row with the same ref value, then set adla1.pflopf to adl.pflopf taken from that one matching row. Otherwise, leave adla1 row unchanged. -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users