The task is to replace the expiration date of the document (datee) with 2012-12-12 for records with status 500 (status field).
A little wrong form the question. There is a script
select * from polis join pers on polis.idpers=pers.idpers join PersStatus on polis.idpers=PersStatus.idpers where idstatus='52' and polis.polisdateF is null and polis.polistype!=1 and datestatus between '20120101' and '20121107'
Then in that he chose (list). In this list, all change the date (polisdatee) for where idstatus = '52 '.
update polis set polisdatee='20121015' where ???