Tweak the sqlite SQL
Tweak sqlite