Im getting this unkown error when running this code:

```
String SELECT_getWhenValueChanged = "SELECT a.* FROM status AS a WHERE a.value <> (SELECT b.value FROM status AS b WHERE a.idCategory = ? AND b.idCategory = a.idCategory and a.timeStamp > b.timeStamp ORDER BY b.timeStamp DESC LIMIT 1) ORDER BY timeStamp DESC";
    try {
        Survey surveyTemp = new Survey();
        surveyTemp = (Survey) getJdbcTemplate()
                .queryForObject(SELECT_getWhenValueChanged,
                        new Object[] { categoryId, categoryId },
                        new SurveyMapper());
        /*
         * SQL Question ask when the value has changed and get the value
         * that changed from and changed to, the first one is the current
         * value and the second is the value before it changed
         */

        if (!surveyTemp.getTimestamp().isEmpty()
                && !presentSurvey.getTimestamp().isEmpty()) {
            presentSurvey.setTimestamp(surveyTemp.getTimestamp());
        }
    } catch (BadSqlGrammarException e) {
        e.printStackTrace();
    } catch (EmptyResultDataAccessException e) {

    } catch (Exception e) {
        e.printStackTrace();
    }
    return presentSurvey;

```

Anybody know what this means?

```
org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [SELECT a.* FROM status AS a WHERE a.value <> (SELECT b.value FROM status AS b WHERE a.idCategory = ? AND b.idCategory = a.idCategory and a.timeStamp > b.timeStamp ORDER BY b.timeStamp DESC LIMIT 1) ORDER BY timeStamp DESC]; Parameter index out of range (2 > number of parameters, which is 1).; nested exception is java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).

```

Im not good at SQL, so dont know how to solve this...