work around different sql math in sqlite vs. mysql