Just do it in the standard SQL way:
select exists( select 1 from tbl_stats_assigned where username = 'abc' );
Assuming your 1 and 0 are actually booleans (which SQLite represents with one and zero, like MySQL).
This should work in any SQL database, and some even have special optimizations to support this idiom.
mu is too short
source share