On 5/15/2014 6:03 AM, YAN HONG YE wrote:
  update adla1 set PFLOPF=(SELECT pflopf from adl where adla1.ref=adl.ref) 
where select count(adl.ref) from adl=1;

Are you looking for something like this?

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

Reply via email to