kreta/Kreta.DataAccess.Migrations/Scripts/20210831100212_KRETA2_9522/KRETA2_9522.sql
2024-03-13 00:33:46 +01:00

140 lines
11 KiB
SQL

update tta2
set C_AGAZATUJSZKTTIPUSID = isnull(tta1.C_AGAZATUJSZKTTIPUSID, 7920)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_AGAZATUJSZKTTIPUSID, 0) <> ISNULL(tta2.C_AGAZATUJSZKTTIPUSID, 1)
-----------------------------
update tta2
set C_SZAKMATIPUSID = isnull(tta1.C_SZAKMATIPUSID, 7946)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_SZAKMATIPUSID, 0) <> ISNULL(tta2.C_SZAKMATIPUSID, 1)
-----------------------------
update tta2
set C_SZAKMAIRANYTIPUSID = isnull(tta1.C_SZAKMAIRANYTIPUSID, 8122)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_SZAKMAIRANYTIPUSID, 0) <> ISNULL(tta2.C_SZAKMAIRANYTIPUSID, 1)
-----------------------------
update tta2
set C_SZAKIRANYNKTTIPUSID = isnull(tta1.C_SZAKIRANYNKTTIPUSID, 8493)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_SZAKIRANYNKTTIPUSID, 0) <> ISNULL(tta2.C_SZAKIRANYNKTTIPUSID, 1)
-----------------------------
update tta2
set C_SZAKKEPESITESNKTTIPUSID = isnull(tta1.C_SZAKKEPESITESNKTTIPUSID, 8464)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_SZAKKEPESITESNKTTIPUSID, 0) <> ISNULL(tta2.C_SZAKKEPESITESNKTTIPUSID, 1)
-----------------------------
update tta2
set C_TANULMANYITERULETNKTTIPUSID = isnull(tta1.C_TANULMANYITERULETNKTTIPUSID, 8459)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_TANULMANYITERULETNKTTIPUSID, 0) <> ISNULL(tta2.C_TANULMANYITERULETNKTTIPUSID, 1)
-----------------------------
update tta2
set C_AGAZATID = isnull(tta1.C_AGAZATID, 5484)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_AGAZATID, 0) <> ISNULL(tta2.C_AGAZATID, 1)
-----------------------------
update tta2
set C_RESZSZAKKEPESITESID = isnull(tta1.C_RESZSZAKKEPESITESID, 6108)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_RESZSZAKKEPESITESID, 0) <> ISNULL(tta2.C_RESZSZAKKEPESITESID, 1)
-----------------------------
update tta2
set C_SZAKKEPESITESID = isnull(tta1.C_SZAKKEPESITESID, 5527)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_SZAKKEPESITESID, 0) <> ISNULL(tta2.C_SZAKKEPESITESID, 1)
-----------------------------
update tta2
set C_SZAKMACSOPORTID = isnull(tta1.C_SZAKMACSOPORTID, 6084)
--select *
from T_FELHASZNALO fh1
inner join T_TANULOCSOPORT tcs1 on tcs1.C_TANULOID = fh1.ID and tcs1.TOROLT = 'F' and tcs1.C_KILEPESDATUM = '2021-08-31'
inner join T_TANULOTANUGYIADATOK tta1 on tta1.C_TANULOCSOPORTID = tcs1.ID and tta1.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs1 on ocs1.ID = tcs1.C_OSZTALYCSOPORTID and ocs1.TOROLT = 'F'
inner join T_FELHASZNALO fh2 on fh2.ELOZOTANEVIREKORDID = fh1.ID and fh2.TOROLT = 'F'
inner join T_TANULOCSOPORT tcs2 on tcs2.C_TANULOID = fh2.ID and tcs2.TOROLT = 'F'
inner join T_TANULOTANUGYIADATOK tta2 on tta2.C_TANULOCSOPORTID = tcs2.ID and tta2.TOROLT = 'F'
inner join T_OSZTALYCSOPORT ocs2 on ocs2.ID = tcs2.C_OSZTALYCSOPORTID and ocs2.TOROLT = 'F' and ocs2.C_FELADATKATEGORIAID = ocs1.C_FELADATKATEGORIAID
inner join T_TANEV te on te.ID = fh1.C_TANEVID and te.TOROLT = 'F' and te.C_NEV = '2020/2021'
where isnull(tta1.C_SZAKMACSOPORTID, 0) <> ISNULL(tta2.C_SZAKMACSOPORTID, 1)
-----------------------------