modify SQL to match SQLITE