I of course forgot to remove 'p005' from the list (luckily David didn't!), so the query should have been:

UPDATE t AS tx SET b = 'z' WHERE (a,idate) = (SELECT ty.a,MAX(ty.idate) FROM t AS ty WHERE ty.a = tx.a GROUP BY ty.a) AND a < 'p005';

which works well here (picking the minimal route), but your actual query may or may not work better with the IN ('p001', 'p002',...) method of checking.


Cheers!
Ryan

On 2019/05/15 4:22 PM, Jose Isaias Cabrera wrote:
Hi.  I know this has been probably asked before by someone, but imagine the 
following scenario//...


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to