sql syntax tweak for sqlite v3.3.6