Fix sql for spotcheck method