All pastes #618543 Raw Edit

Untitled

public text v1 · immutable
·published 2007-07-14 00:54 UTC
rendered paste body
Query

UPDATE
    people, booths
SET booths.status = '2',
    people.booth_id =
       (SELECT booths.id
        FROM booths LEFT JOIN status ON booths.status = status.id
        WHERE 
            (booths.status = '1' OR booths.status = 0 OR booths.id = people.booth_id) AND booths.id = '25'
       )
WHERE people.id = '4' AND (booths.status = '1' OR booths.status = 0 OR booths.id = people.booth_id) AND booths.id = '25'

Error:

You can't specify target table 'people' for update in FROM clause