Trying to get a query to work. I have an email address as a variable and need to update all rows in this ranking that are above the matching record. The query:

```
UPDATE quiz_1_highscore 
    SET rate = rate - 1 
WHERE rate >= ( SELECT rate FROM quiz_1_highscore WHERE email = ? )

```

Then I bind the parameter for the email from a form submit, but the query does not work.

I don't want to make two calls to the database - one to get the rate in that email row, and a second one to perform the update. Can I do it all in one query?

**EDIT:**

Just trying to add Caius comment:

```
UPDATE quiz_1_highscore AS T1 SET T1.rate = T1.rate - 1 WHERE T1.rate >= ( SELECT MAX(T2.rate) FROM quiz_1_highscore AS T2 WHERE T2.email = ? );

```

This work if I run it in "mysql workbrench" - but in my php files I get that error -

```
ErrorSQLSTATE[HY000]: General error: 1093 Table 'T1' is specified twice, both as a target for 'UPDATE' and as a separate source for data

```

PLEASE HELP :\