> It's probably not a good idea, because it depends on some > behaviour that is not specified, but I once used a trick > like this to get good performance: > > CREATE TABLE abc(a, b); > UPDATE abc SET b = user2(a, b) WHERE <condition> AND user1(a, b); > > SQLite loops through the rows where <condition> is true, and > remembers those for which user1() returns true. It then runs > a second loop through those rows and calls user2() for each > of the remembered rows, setting 'b' to the return value.
That's an interesting trick. It has no way to retrieve the rows you want to operate on though. I guess you could make every column you needed a parameters to the user2() function and do your processing there.