On Sat, Feb 8, 2014 at 12:39 PM, RSmith <rsm...@rsweb.co.za> wrote: > SELECT name, max(vid=2)-max(vid=1) FROM v GROUP BY name; > > So much more succint than my original, like I predicted :)
Indeed!!! This one wins if i am able to refactor it for use with the much more complex structure i'm actually working with (the fossil SCM's vfile table - my example is a simplified form to help me get my head around the SQL). FWIW, sqlite3's ".stats" say yours is overall more efficient: Virtual Machine Steps: 242 vs the WITH variant i posted: Virtual Machine Steps: 308 Thanks again! -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users