Don't forget that SQLite isn't some Client-Server database, but runs in your userspace. Anything that SQLite reads, HAS come into your application, it just stayed inside the subroutine call. The cost to move the results from inside SQLite to 'your app' is small, and if SQLite doesn't have something built in to do the operation, it is likely faster to read the data and decide for yourself.