﻿UPDATE o SET
  o.C_NYELVIELOKESZITO = 'T'
FROM T_OSZTALY o
  INNER JOIN T_OSZTALYCSOPORT ocs ON ocs.ID = o.ID
    AND ocs.TOROLT = 'F'
WHERE C_EVFOLYAMTIPUSA IN (SELECT DISTINCT ID
                           FROM T_DICTIONARYITEMBASE
                           WHERE C_NAME IN ('5/Ny', '7/Ny', '9/Ny')
                             AND C_TYPE = 'EvfolyamTipus'
                             AND TOROLT = 'F')
  AND o.TOROLT = 'F'

GO
