I am trying to update the member row with the highest start date using:

```
UPDATE at_section_details a 
   SET a.sd_end_date = ?
     , a.sd_details = ?
 WHERE a.cd_id = ? 
   AND a.sd_start_date = (SELECT MAX(b.sd_start_date) 
                            FROM at_section_details b 
                           WHERE b.cd_id = ?)

```

The error message is:
"SQLException in updateYMGroup: java.sql.SQLException: You can't specify target table 'a' for update in FROM clause

The table structure is:
sd\_id - primary key

cd\_id - foreign key (many occurrences)

sd\_section

sd\_pack

sd\_start\_date

sd\_end\_date

sd\_details

A member (cd\_id) can start and then transfer out.
The member can then transfer in again (new start date). When they transfer out we want to pick up the max start date to transfer out against.

Any assistance would be greatly appreciated.

Regards,

Glyn