SQL query error for getting product list