text: USE [VipunenTK_SA]
  GO
  
  /****** Object:  View [dbo].[v_sa_5_4_Yosairaaloiden_tutkimus_ja_kehitys]    Script Date: 12.12.2017 14:32:41 ******/
  SET ANSI_NULLS ON
  GO
  
  SET QUOTED_IDENTIFIER ON
  GO
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  ALTER VIEW [dbo].[v_sa_5_4_Yosairaaloiden_tutkimus_ja_kehitys] AS
  /*
  Aineisto muuttui K-aineistoksi 2016. K-koodia ei lisätty näkymän nimeen. /18.1.2016 CSC Jarmo
  K poistettu /16.2.2016 CSC Jarmo
  
  Drop table [VipunenTK_DW].[dbo].[sa_5_4_Yosairaaloiden_tutkimus_ja_kehitys]
  Select * into [VipunenTK_DW].[dbo].[sa_5_4_Yosairaaloiden_tutkimus_ja_kehitys] FROM VipunenTK_SA.[dbo].[v_sa_5_4_Yosairaaloiden_tutkimus_ja_kehitys]
  
  Truncate table [VipunenTK_DW].[dbo].[sa_5_4_Yosairaaloiden_tutkimus_ja_kehitys]
  Insert into [VipunenTK_DW].[dbo].[sa_5_4_Yosairaaloiden_tutkimus_ja_kehitys]
    Select * FROM VipunenTK_SA.[dbo].[v_sa_5_4_Yosairaaloiden_tutkimus_ja_kehitys]
  */
  
  SELECT [tilv] = CAST(kaikkivuodet.tilv as nvarchar(4))
  	  ,[tilv_date] = Cast(kaikkivuodet.tilv+'0101' as date)
        ,[NIMI]
        ,[NIMI2]
        ,[TK_koodi] = Cast(Right('00000' + kaikkivuodet.TK_koodi, 5) as varchar(5))
        ,[TOLKM]
        ,[NTOLKM]
        ,[TOTTV]
        ,[LISLKM]
        ,[NLISLKM]
        ,[LISTTV]
        ,[DILKM]
        ,[NDIPLKM]
        ,[DIPTTV]
        ,[INSLKM]
        ,[NOPINS]
        ,[OPINSTTV]
        ,[YHTE]
        ,[NYHTE]
        ,[YHTTTV]
        ,[PAME]
        ,[OSTPAL]
        ,[YHME]
        ,[TEKES]
        ,[MTEM]
        ,[AKATEMIA]
        ,[GRAD]
        ,[MOPEM]
        ,[LIIKM]
        ,[MAAM]
        ,[OM]
        ,[PM]
        ,[SISAM]
        ,[SOSM]
        ,[UM]
        ,[VN]
        ,[VM]
        ,[YMP]
        ,[MUUJU]
        ,[RAHAS]
        ,[KOTIM]
        ,[ULKOY]
        ,[UEU]
  	  ,[EUPUITE]
  	  ,[EAKR]
  	  ,[ESR]
  	  ,[MUUEU]
        ,[MULKO]
        ,[UYHTE]
        ,[KUNTA1] = Cast(Nullif(Right('000'+Cast(KUNTA1 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA2] = Cast(Nullif(Right('000'+Cast(KUNTA2 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA3] = Cast(Nullif(Right('000'+Cast(KUNTA3 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA4] = Cast(Nullif(Right('000'+Cast(KUNTA4 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA5] = Cast(Nullif(Right('000'+Cast(KUNTA5 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA6] = Cast(Nullif(Right('000'+Cast(KUNTA6 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA7] = Cast(Nullif(Right('000'+Cast(KUNTA7 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA8] = Cast(Nullif(Right('000'+Cast(KUNTA8 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA9] = Cast(Nullif(Right('000'+Cast(KUNTA9 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA10] = Cast(Nullif(Right('000'+Cast(KUNTA10 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA11] = Cast(Nullif(Right('000'+Cast(KUNTA11 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA12] = Cast(Nullif(Right('000'+Cast(KUNTA12 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA13] = Cast(Nullif(Right('000'+Cast(KUNTA13 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA14] = Cast(Nullif(Right('000'+Cast(KUNTA14 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA15] = Cast(Nullif(Right('000'+Cast(KUNTA15 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA16] = Cast(Nullif(Right('000'+Cast(KUNTA16 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA17] = Cast(Nullif(Right('000'+Cast(KUNTA17 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA18] = Cast(Nullif(Right('000'+Cast(KUNTA18 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA19] = Cast(Nullif(Right('000'+Cast(KUNTA19 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA20] = Cast(Nullif(Right('000'+Cast(KUNTA20 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA21] = Cast(Nullif(Right('000'+Cast(KUNTA21 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA22] = Cast(Nullif(Right('000'+Cast(KUNTA22 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA23] = Cast(Nullif(Right('000'+Cast(KUNTA23 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA24] = Cast(Nullif(Right('000'+Cast(KUNTA24 as varchar(3)),3),'000') as varchar(3))
        ,[KUNTA25] = Cast(Nullif(Right('000'+Cast(KUNTA25 as varchar(3)),3),'000') as varchar(3))
        ,[HENLKMY]
        ,[TYOVY]
        ,[TKMENOY]
        ,[HENLKM1]
        ,[HENLKM2]
        ,[HENLKM3]
        ,[HENLKM4]
        ,[HENLKM5]
        ,[HENLKM6]
        ,[HENLKM7]
        ,[HENLKM8]
        ,[HENLKM9]
        ,[HENLKM10]
        ,[HENLKM11]
        ,[HENLKM12]
        ,[HENLKM13]
        ,[HENLKM14]
        ,[HENLKM15]
        ,[HENLKM16]
        ,[HENLKM17]
        ,[HENLKM18]
        ,[HENLKM19]
        ,[HENLKM20]
        ,[HENLKM21]
        ,[HENLKM22]
        ,[HENLKM23]
        ,[HENLKM24]
        ,[HENLKM25]
        ,[TYOV1]
        ,[TYOV2]
        ,[TYOV3]
        ,[TYOV4]
        ,[TYOV5]
        ,[TYOV6]
        ,[TYOV7]
        ,[TYOV8]
        ,[TYOV9]
        ,[TYOV10]
        ,[TYOV11]
        ,[TYOV12]
        ,[TYOV13]
        ,[TYOV14]
        ,[TYOV15]
        ,[TYOV16]
        ,[TYOV17]
        ,[TYOV18]
        ,[TYOV19]
        ,[TYOV20]
        ,[TYOV21]
        ,[TYOV22]
        ,[TYOV23]
        ,[TYOV24]
        ,[TYOV25]
        ,[TKMENO1]
        ,[TKMENO2]
        ,[TKMENO3]
        ,[TKMENO4]
        ,[TKMENO5]
        ,[TKMENO6]
        ,[TKMENO7]
        ,[TKMENO8]
        ,[TKMENO9]
        ,[TKMENO10]
        ,[TKMENO11]
        ,[TKMENO12]
        ,[TKMENO13]
        ,[TKMENO14]
        ,[TKMENO15]
        ,[TKMENO16]
        ,[TKMENO17]
        ,[TKMENO18]
        ,[TKMENO19]
        ,[TKMENO20]
        ,[TKMENO21]
        ,[TKMENO22]
        ,[TKMENO23]
        ,[TKMENO24]
        ,[TKMENO25]
        ,[TA1] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA1 as varchar(4)), '0') as varchar(10))
        ,[TA2] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA2 as varchar(4)), '0') as varchar(10))
        ,[TA3] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA3 as varchar(4)), '0') as varchar(10))
        ,[TA4] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA4 as varchar(4)), '0') as varchar(10))
        ,[TA5] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA5 as varchar(4)), '0') as varchar(10))
        ,[TA6] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA6 as varchar(4)), '0') as varchar(10))
        ,[TA7] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA7 as varchar(4)), '0') as varchar(10))
        ,[TA8] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA8 as varchar(4)), '0') as varchar(10))
        ,[TA9] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA9 as varchar(4)), '0') as varchar(10))
        ,[TA10] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA10 as varchar(4)), '0') as varchar(10))
        ,[TA11] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA11 as varchar(4)), '0') as varchar(10))
        ,[TA12] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA12 as varchar(4)), '0') as varchar(10))
        ,[TA13] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA13 as varchar(4)), '0') as varchar(10))
        ,[TA14] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA14 as varchar(4)), '0') as varchar(10))
        ,[TA15] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA15 as varchar(4)), '0') as varchar(10))
        ,[TA16] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA16 as varchar(4)), '0') as varchar(10))
        ,[TA17] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA17 as varchar(4)), '0') as varchar(10))
        ,[TA18] = Cast(tieteenalakoodisto + '_' + Nullif(Cast(TA18 as varchar(4)), '0') as varchar(10))
        ,[TA1P]
        ,[TA2P]
        ,[TA3P]
        ,[TA4P]
        ,[TA5P]
        ,[TA6P]
        ,[TA7P]
        ,[TA8P]
        ,[TA9P]
        ,[TA10P]
        ,[TA11P]
        ,[TA12P]
        ,[TA13P]
        ,[TA14P]
        ,[TA15P]
        ,[TA16P]
        ,[TA17P]
        ,[TA18P]
        ,[tk_arvio]
        ,[tk_arvioe]
        ,[KMENO]
        ,[HMENO]
        ,[TUTLKM]
        ,[NTUTLKM]
        ,[TUTTTV]
        ,[MTKLKM]
        ,[NMTKLKM]
        ,[MTKTTV]
        ,[YHTE2]
        ,[NYHTE2]
        ,[MKOULKM]
        ,[NMKOULKM]
        ,[MKOUTTV]
        ,[OPISTLKM]
        ,[NOPISTLKM]
        ,[OPISTTTV]
        ,[KUNNAT]
        ,[MKVJ]
        ,[ORAHAS]
        ,[phy1]
        ,[phy2]
        ,[phy3]
        ,[phy4]
        ,[phy5]
        ,[phy6]
        ,[phyy]
        ,[phn1]
        ,[phn2]
        ,[phn3]
        ,[phn4]
        ,[phn5]
        ,[phn6]
        ,[phny]
        ,[pty1]
        ,[pty2]
        ,[pty3]
        ,[pty4]
        ,[pty5]
        ,[pty6]
        ,[ptyy]
        ,[ptn1]
        ,[ptn2]
        ,[ptn3]
        ,[ptn4]
        ,[ptn5]
        ,[ptn6]
        ,[ptny]
  	  ,[RKORK]
        ,[tietolahde] = CAST(kaikkivuodet.tietolahde as nvarchar(50))
        ,[rivinumero] = CAST(kaikkivuodet.rivinumero as int)
  
  FROM ( --kaikkivuodet
  
  SELECT [tilv]
        ,[NIMI]
        ,[NIMI2]
        ,[TK_koodi]
        ,[TOLKM]
        ,[NTOLKM]
        ,[TOTTV]
        ,[LISLKM]
        ,[NLISLKM]
        ,[LISTTV]
        ,[DILKM]
        ,[NDIPLKM]
        ,[DIPTTV]
        ,[INSLKM]
        ,[NOPINS]
        ,[OPINSTTV]
        ,[YHTE]
        ,[NYHTE]
        ,[YHTTTV]
        ,[PAME]
        ,[OSTPAL]
        ,[YHME]
        ,[TEKES]
        ,[MTEM]
        ,[AKATEMIA]
        ,[GRAD]
        ,[MOPEM]
        ,[LIIKM]
        ,[MAAM]
        ,[OM]
        ,[PM]
        ,[SISAM]
        ,[SOSM]
        ,[UM]
        ,[VN]
        ,[VM]
        ,[YMP]
        ,[MUUJU]
        ,[RAHAS]
        ,[KOTIM]
        ,[ULKOY]
        ,[UEU]
  	  ,[EUPUITE] = NULL
  	  ,[EAKR] = NULL
  	  ,[ESR] = NULL
  	  ,[MUUEU] = NULL
        ,[MULKO]
        ,[UYHTE]
        ,[KUNTA1]
        ,[KUNTA2]
        ,[KUNTA3]
        ,[KUNTA4]
        ,[KUNTA5]
        ,[KUNTA6]
        ,[KUNTA7]
        ,[KUNTA8]
        ,[KUNTA9]
        ,[KUNTA10]
        ,[KUNTA11]
        ,[KUNTA12]
        ,[KUNTA13]
        ,[KUNTA14]
        ,[KUNTA15]
        ,[KUNTA16]
        ,[KUNTA17]
        ,[KUNTA18]
        ,[KUNTA19]
        ,[KUNTA20]
        ,[KUNTA21]
        ,[KUNTA22]
        ,[KUNTA23]
        ,[KUNTA24]
        ,[KUNTA25]
        ,[HENLKMY]
        ,[TYOVY]
        ,[TKMENOY]
        ,[HENLKM1]
        ,[HENLKM2]
        ,[HENLKM3]
        ,[HENLKM4]
        ,[HENLKM5]
        ,[HENLKM6]
        ,[HENLKM7]
        ,[HENLKM8]
        ,[HENLKM9]
        ,[HENLKM10]
        ,[HENLKM11]
        ,[HENLKM12]
        ,[HENLKM13]
        ,[HENLKM14]
        ,[HENLKM15]
        ,[HENLKM16]
        ,[HENLKM17]
        ,[HENLKM18]
        ,[HENLKM19]
        ,[HENLKM20]
        ,[HENLKM21]
        ,[HENLKM22]
        ,[HENLKM23]
        ,[HENLKM24]
        ,[HENLKM25]
        ,[TYOV1]
        ,[TYOV2]
        ,[TYOV3]
        ,[TYOV4]
        ,[TYOV5]
        ,[TYOV6]
        ,[TYOV7]
        ,[TYOV8]
        ,[TYOV9]
        ,[TYOV10]
        ,[TYOV11]
        ,[TYOV12]
        ,[TYOV13]
        ,[TYOV14]
        ,[TYOV15]
        ,[TYOV16]
        ,[TYOV17]
        ,[TYOV18]
        ,[TYOV19]
        ,[TYOV20]
        ,[TYOV21]
        ,[TYOV22]
        ,[TYOV23]
        ,[TYOV24]
        ,[TYOV25]
        ,[TKMENO1]
        ,[TKMENO2]
        ,[TKMENO3]
        ,[TKMENO4]
        ,[TKMENO5]
        ,[TKMENO6]
        ,[TKMENO7]
        ,[TKMENO8]
        ,[TKMENO9]
        ,[TKMENO10]
        ,[TKMENO11]
        ,[TKMENO12]
        ,[TKMENO13]
        ,[TKMENO14]
        ,[TKMENO15]
        ,[TKMENO16]
        ,[TKMENO17]
        ,[TKMENO18]
        ,[TKMENO19]
        ,[TKMENO20]
        ,[TKMENO21]
        ,[TKMENO22]
        ,[TKMENO23]
        ,[TKMENO24]
        ,[TKMENO25]
        ,[TA1]
        ,[TA2]
        ,[TA3]
        ,[TA4]
        ,[TA5]
        ,[TA6]
        ,[TA7]
        ,[TA8]
        ,[TA9]
        ,[TA10]
        ,[TA11]
        ,[TA12]
        ,[TA13]
        ,[TA14]
        ,[TA15]
        ,[TA16]
        ,[TA17]
        ,[TA18]
        ,[TA1P]
        ,[TA2P]
        ,[TA3P]
        ,[TA4P]
        ,[TA5P]
        ,[TA6P]
        ,[TA7P]
        ,[TA8P]
        ,[TA9P]
        ,[TA10P]
        ,[TA11P]
        ,[TA12P]
        ,[TA13P]
        ,[TA14P]
        ,[TA15P]
        ,[TA16P]
        ,[TA17P]
        ,[TA18P]
        ,[tk_arvio]
        ,[tk_arvioe]
        ,[KMENO]
        ,[HMENO]
        ,[TUTLKM]
        ,[NTUTLKM]
        ,[TUTTTV]
        ,[MTKLKM]
        ,[NMTKLKM]
        ,[MTKTTV]
        ,[YHTE2]
        ,[NYHTE2]
        ,[MKOULKM]
        ,[NMKOULKM]
        ,[MKOUTTV]
        ,[OPISTLKM]
        ,[NOPISTLKM]
        ,[OPISTTTV]
        ,[KUNNAT]
        ,[MKVJ]
        ,[ORAHAS]
        ,[phy1]
        ,[phy2]
        ,[phy3]
        ,[phy4]
        ,[phy5]
        ,[phy6]
        ,[phyy]
        ,[phn1]
        ,[phn2]
        ,[phn3]
        ,[phn4]
        ,[phn5]
        ,[phn6]
        ,[phny]
        ,[pty1]
        ,[pty2]
        ,[pty3]
        ,[pty4]
        ,[pty5]
        ,[pty6]
        ,[ptyy]
        ,[ptn1]
        ,[ptn2]
        ,[ptn3]
        ,[ptn4]
        ,[ptn5]
        ,[ptn6]
        ,[ptny]
        ,[RKORK]=NULL
  	  ,[luontipvm]
  	  ,tieteenalakoodisto='TA07'
        ,[tietolahde]='TK_5_4_sopv_12_yosair'
        ,[rivinumero] = ROW_NUMBER() OVER(ORDER BY TK_Koodi)
  FROM [TK_H9098_CSC].[dbo].[TK_5_4_sopv_12_yosair]
  
  UNION ALL
  
  SELECT [tilv]
        ,[NIMI]
        ,[NIMI2]
        ,[TK_koodi]
        ,[TOLKM]
        ,[NTOLKM]
        ,[TOTTV]
        ,[LISLKM]
        ,[NLISLKM]
        ,[LISTTV]
        ,[DILKM]
        ,[NDIPLKM]
        ,[DIPTTV]
        ,[INSLKM]
        ,[NOPINS]
        ,[OPINSTTV]
        ,[YHTE]
        ,[NYHTE]
        ,[YHTTTV]
        ,[PAME]
        ,[OSTPAL]
        ,[YHME]
        ,[TEKES]
        ,[MTEM]
        ,[AKATEMIA]
        ,[GRAD]
        ,[MOPEM]
        ,[LIIKM]
        ,[MAAM]
        ,[OM]
        ,[PM]
        ,[SISAM]
        ,[SOSM]
        ,[UM]
        ,[VN]
        ,[VM]
        ,[YMP]
        ,[MUUJU]
        ,[RAHAS]
        ,[KOTIM]
        ,[ULKOY]
        ,[UEU]
  	  ,[EUPUITE]=0.0
  	  ,[EAKR]=0.0
  	  ,[ESR]=0.0
  	  ,[MUUEU]=0.0
        ,[MULKO]
        ,[UYHTE]
        ,[KUNTA1]
        ,[KUNTA2]
        ,[KUNTA3]
        ,[KUNTA4]
        ,[KUNTA5]
        ,[KUNTA6]
        ,[KUNTA7]
        ,[KUNTA8]
        ,[KUNTA9]
        ,[KUNTA10]
        ,[KUNTA11]
        ,[KUNTA12]
        ,[KUNTA13]
        ,[KUNTA14]
        ,[KUNTA15]
        ,[KUNTA16]
        ,[KUNTA17]
        ,[KUNTA18]
        ,[KUNTA19]
        ,[KUNTA20]
        ,[KUNTA21]
        ,[KUNTA22]
        ,[KUNTA23]
        ,[KUNTA24]
        ,[KUNTA25]
        ,[HENLKMY]
        ,[TYOVY]
        ,[TKMENOY]
        ,[HENLKM1]
        ,[HENLKM2]
        ,[HENLKM3]
        ,[HENLKM4]
        ,[HENLKM5]
        ,[HENLKM6]
        ,[HENLKM7]
        ,[HENLKM8]
        ,[HENLKM9]
        ,[HENLKM10]
        ,[HENLKM11]
        ,[HENLKM12]
        ,[HENLKM13]
        ,[HENLKM14]
        ,[HENLKM15]
        ,[HENLKM16]
        ,[HENLKM17]
        ,[HENLKM18]
        ,[HENLKM19]
        ,[HENLKM20]
        ,[HENLKM21]
        ,[HENLKM22]
        ,[HENLKM23]
        ,[HENLKM24]
        ,[HENLKM25]
        ,[TYOV1]
        ,[TYOV2]
        ,[TYOV3]
        ,[TYOV4]
        ,[TYOV5]
        ,[TYOV6]
        ,[TYOV7]
        ,[TYOV8]
        ,[TYOV9]
        ,[TYOV10]
        ,[TYOV11]
        ,[TYOV12]
        ,[TYOV13]
        ,[TYOV14]
        ,[TYOV15]
        ,[TYOV16]
        ,[TYOV17]
        ,[TYOV18]
        ,[TYOV19]
        ,[TYOV20]
        ,[TYOV21]
        ,[TYOV22]
        ,[TYOV23]
        ,[TYOV24]
        ,[TYOV25]
        ,[TKMENO1]
        ,[TKMENO2]
        ,[TKMENO3]
        ,[TKMENO4]
        ,[TKMENO5]
        ,[TKMENO6]
        ,[TKMENO7]
        ,[TKMENO8]
        ,[TKMENO9]
        ,[TKMENO10]
        ,[TKMENO11]
        ,[TKMENO12]
        ,[TKMENO13]
        ,[TKMENO14]
        ,[TKMENO15]
        ,[TKMENO16]
        ,[TKMENO17]
        ,[TKMENO18]
        ,[TKMENO19]
        ,[TKMENO20]
        ,[TKMENO21]
        ,[TKMENO22]
        ,[TKMENO23]
        ,[TKMENO24]
        ,[TKMENO25]
        ,[TA1]
        ,[TA2]
        ,[TA3]
        ,[TA4]
        ,[TA5]
        ,[TA6]
        ,[TA7]
        ,[TA8]
        ,[TA9]
        ,[TA10]
        ,[TA11]
        ,[TA12]
        ,[TA13]
        ,[TA14]
        ,[TA15]
        ,[TA16]
        ,[TA17]
        ,[TA18]
        ,[TA1P]
        ,[TA2P]
        ,[TA3P]
        ,[TA4P]
        ,[TA5P]
        ,[TA6P]
        ,[TA7P]
        ,[TA8P]
        ,[TA9P]
        ,[TA10P]
        ,[TA11P]
        ,[TA12P]
        ,[TA13P]
        ,[TA14P]
        ,[TA15P]
        ,[TA16P]
        ,[TA17P]
        ,[TA18P]
        ,[tk_arvio]
        ,[tk_arvioe]
        ,[KMENO]
        ,[HMENO]
        ,[TUTLKM]
        ,[NTUTLKM]
        ,[TUTTTV]
        ,[MTKLKM]
        ,[NMTKLKM]
        ,[MTKTTV]
        ,[YHTE2]
        ,[NYHTE2]
        ,[MKOULKM]
        ,[NMKOULKM]
        ,[MKOUTTV]
        ,[OPISTLKM]
        ,[NOPISTLKM]
        ,[OPISTTTV]
        ,[KUNNAT]
        ,[MKVJ]
        ,[ORAHAS]
        ,[phy1]
        ,[phy2]
        ,[phy3]
        ,[phy4]
        ,[phy5]
        ,[phy6]
        ,[phyy]
        ,[phn1]
        ,[phn2]
        ,[phn3]
        ,[phn4]
        ,[phn5]
        ,[phn6]
        ,[phny]
        ,[pty1]
        ,[pty2]
        ,[pty3]
        ,[pty4]
        ,[pty5]
        ,[pty6]
        ,[ptyy]
        ,[ptn1]
        ,[ptn2]
        ,[ptn3]
        ,[ptn4]
        ,[ptn5]
        ,[ptn6]
        ,[ptny]
        ,[RKORK]=NULL
  	  ,[luontipvm]
  	  ,tieteenalakoodisto='TA10'
        ,[tietolahde]='TK_5_4_sopv_13_yosair'
        ,[rivinumero] = ROW_NUMBER() OVER(ORDER BY TK_Koodi)
  FROM [TK_H9098_CSC].[dbo].[TK_5_4_sopv_13_yosair]
  
  UNION ALL
  
  SELECT [tilv]
        ,[NIMI]
        ,[NIMI2]
        ,[TK_koodi]
        ,[TOLKM]
        ,[NTOLKM]
        ,[TOTTV]
        ,[LISLKM]
        ,[NLISLKM]
        ,[LISTTV]
        ,[DILKM]
        ,[NDIPLKM]
        ,[DIPTTV]
        ,[INSLKM]
        ,[NOPINS]
        ,[OPINSTTV]
        ,[YHTE]
        ,[NYHTE]
        ,[YHTTTV]
        ,[PAME]
        ,[OSTPAL]
        ,[YHME]
        ,[TEKES]
        ,[MTEM]
        ,[AKATEMIA]
        ,[GRAD]
        ,[MOPEM]
        ,[LIIKM]
        ,[MAAM]
        ,[OM]
        ,[PM]
        ,[SISAM]
        ,[SOSM]
        ,[UM]
        ,[VN]
        ,[VM]
        ,[YMP]
        ,[MUUJU]
        ,[RAHAS]
        ,[KOTIM]
        ,[ULKOY]
        ,[UEU]
  	  ,[EUPUITE]=0.0
  	  ,[EAKR]=0.0
  	  ,[ESR]=0.0
  	  ,[MUUEU]=0.0
        ,[MULKO]
        ,[UYHTE]
        ,[KUNTA1]
        ,[KUNTA2]
        ,[KUNTA3]
        ,[KUNTA4]
        ,[KUNTA5]
        ,[KUNTA6]
        ,[KUNTA7]
        ,[KUNTA8]
        ,[KUNTA9]
        ,[KUNTA10]
        ,[KUNTA11]
        ,[KUNTA12]
        ,[KUNTA13]
        ,[KUNTA14]
        ,[KUNTA15]
        ,[KUNTA16]
        ,[KUNTA17]
        ,[KUNTA18]
        ,[KUNTA19]
        ,[KUNTA20]
        ,[KUNTA21]
        ,[KUNTA22]
        ,[KUNTA23]
        ,[KUNTA24]
        ,[KUNTA25]
        ,[HENLKMY]
        ,[TYOVY]
        ,[TKMENOY]
        ,[HENLKM1]
        ,[HENLKM2]
        ,[HENLKM3]
        ,[HENLKM4]
        ,[HENLKM5]
        ,[HENLKM6]
        ,[HENLKM7]
        ,[HENLKM8]
        ,[HENLKM9]
        ,[HENLKM10]
        ,[HENLKM11]
        ,[HENLKM12]
        ,[HENLKM13]
        ,[HENLKM14]
        ,[HENLKM15]
        ,[HENLKM16]
        ,[HENLKM17]
        ,[HENLKM18]
        ,[HENLKM19]
        ,[HENLKM20]
        ,[HENLKM21]
        ,[HENLKM22]
        ,[HENLKM23]
        ,[HENLKM24]
        ,[HENLKM25]
        ,[TYOV1]
        ,[TYOV2]
        ,[TYOV3]
        ,[TYOV4]
        ,[TYOV5]
        ,[TYOV6]
        ,[TYOV7]
        ,[TYOV8]
        ,[TYOV9]
        ,[TYOV10]
        ,[TYOV11]
        ,[TYOV12]
        ,[TYOV13]
        ,[TYOV14]
        ,[TYOV15]
        ,[TYOV16]
        ,[TYOV17]
        ,[TYOV18]
        ,[TYOV19]
        ,[TYOV20]
        ,[TYOV21]
        ,[TYOV22]
        ,[TYOV23]
        ,[TYOV24]
        ,[TYOV25]
        ,[TKMENO1]
        ,[TKMENO2]
        ,[TKMENO3]
        ,[TKMENO4]
        ,[TKMENO5]
        ,[TKMENO6]
        ,[TKMENO7]
        ,[TKMENO8]
        ,[TKMENO9]
        ,[TKMENO10]
        ,[TKMENO11]
        ,[TKMENO12]
        ,[TKMENO13]
        ,[TKMENO14]
        ,[TKMENO15]
        ,[TKMENO16]
        ,[TKMENO17]
        ,[TKMENO18]
        ,[TKMENO19]
        ,[TKMENO20]
        ,[TKMENO21]
        ,[TKMENO22]
        ,[TKMENO23]
        ,[TKMENO24]
        ,[TKMENO25]
        ,[TA1]
        ,[TA2]
        ,[TA3]
        ,[TA4]
        ,[TA5]
        ,[TA6]
        ,[TA7]
        ,[TA8]
        ,[TA9]
        ,[TA10]
        ,[TA11]
        ,[TA12]
        ,[TA13]
        ,[TA14]
        ,[TA15]
        ,[TA16]
        ,[TA17]
        ,[TA18]
        ,[TA1P]
        ,[TA2P]
        ,[TA3P]
        ,[TA4P]
        ,[TA5P]
        ,[TA6P]
        ,[TA7P]
        ,[TA8P]
        ,[TA9P]
        ,[TA10P]
        ,[TA11P]
        ,[TA12P]
        ,[TA13P]
        ,[TA14P]
        ,[TA15P]
        ,[TA16P]
        ,[TA17P]
        ,[TA18P]
        ,[tk_arvio]
        ,[tk_arvioe]
        ,[KMENO]
        ,[HMENO]
        ,[TUTLKM]
        ,[NTUTLKM]
        ,[TUTTTV]
        ,[MTKLKM]
        ,[NMTKLKM]
        ,[MTKTTV]
        ,[YHTE2]
        ,[NYHTE2]
        ,[MKOULKM]
        ,[NMKOULKM]
        ,[MKOUTTV]
        ,[OPISTLKM]
        ,[NOPISTLKM]
        ,[OPISTTTV]
        ,[KUNNAT]
        ,[MKVJ]
        ,[ORAHAS]
        ,[phy1]
        ,[phy2]
        ,[phy3]
        ,[phy4]
        ,[phy5]
        ,[phy6]
        ,[phyy]
        ,[phn1]
        ,[phn2]
        ,[phn3]
        ,[phn4]
        ,[phn5]
        ,[phn6]
        ,[phny]
        ,[pty1]
        ,[pty2]
        ,[pty3]
        ,[pty4]
        ,[pty5]
        ,[pty6]
        ,[ptyy]
        ,[ptn1]
        ,[ptn2]
        ,[ptn3]
        ,[ptn4]
        ,[ptn5]
        ,[ptn6]
        ,[ptny]
        ,[RKORK]=NULL
  	  ,[luontipvm]
  	  ,tieteenalakoodisto='TA10'
        ,[tietolahde]='TK_5_4_sopv_14_yosair'
        ,[rivinumero] = ROW_NUMBER() OVER(ORDER BY TK_Koodi)
  FROM [TK_H9098_CSC].[dbo].[TK_5_4_sopv_14_yosair]
  
  UNION ALL
  
  SELECT [tilv]
        ,[NIMI]
        ,[NIMI2]
        ,[TK_koodi]
        ,[TOLKM]
        ,[NTOLKM]
        ,[TOTTV]
        ,[LISLKM]
        ,[NLISLKM]
        ,[LISTTV]
        ,[DILKM]
        ,[NDIPLKM]
        ,[DIPTTV]
        ,[INSLKM]
        ,[NOPINS]
        ,[OPINSTTV]
        ,[YHTE]
        ,[NYHTE]
        ,[YHTTTV]
        ,[PAME]
        ,[OSTPAL]
        ,[YHME]
        ,[TEKES]
        ,[MTEM]
        ,[AKATEMIA]
        ,[GRAD]
        ,[MOPEM]
        ,[LIIKM]
        ,[MAAM]
        ,[OM]
        ,[PM]
        ,[SISAM]
        ,[SOSM]
        ,[UM]
        ,[VN]
        ,[VM]
        ,[YMP]
        ,[MUUJU]
        ,[RAHAS]
        ,[KOTIM]
        ,[ULKOY]
        ,[UEU]
  	  ,[EUPUITE] = NULL
  	  ,[EAKR] = NULL
  	  ,[ESR] = NULL
  	  ,[MUUEU] = NULL
        ,[MULKO]
        ,[UYHTE]
        ,[KUNTA1]
        ,[KUNTA2]
        ,[KUNTA3]
        ,[KUNTA4]
        ,[KUNTA5]
        ,[KUNTA6]
        ,[KUNTA7]
        ,[KUNTA8]
        ,[KUNTA9]
        ,[KUNTA10]
        ,[KUNTA11]
        ,[KUNTA12]
        ,[KUNTA13]
        ,[KUNTA14]
        ,[KUNTA15]
        ,[KUNTA16]
        ,[KUNTA17]
        ,[KUNTA18]
        ,[KUNTA19]
        ,[KUNTA20]
        ,[KUNTA21]
        ,[KUNTA22]
        ,[KUNTA23]
        ,[KUNTA24]
        ,[KUNTA25]
        ,[HENLKMY]
        ,[TYOVY]
        ,[TKMENOY]
        ,[HENLKM1]
        ,[HENLKM2]
        ,[HENLKM3]
        ,[HENLKM4]
        ,[HENLKM5]
        ,[HENLKM6]
        ,[HENLKM7]
        ,[HENLKM8]
        ,[HENLKM9]
        ,[HENLKM10]
        ,[HENLKM11]
        ,[HENLKM12]
        ,[HENLKM13]
        ,[HENLKM14]
        ,[HENLKM15]
        ,[HENLKM16]
        ,[HENLKM17]
        ,[HENLKM18]
        ,[HENLKM19]
        ,[HENLKM20]
        ,[HENLKM21]
        ,[HENLKM22]
        ,[HENLKM23]
        ,[HENLKM24]
        ,[HENLKM25]
        ,[TYOV1]
        ,[TYOV2]
        ,[TYOV3]
        ,[TYOV4]
        ,[TYOV5]
        ,[TYOV6]
        ,[TYOV7]
        ,[TYOV8]
        ,[TYOV9]
        ,[TYOV10]
        ,[TYOV11]
        ,[TYOV12]
        ,[TYOV13]
        ,[TYOV14]
        ,[TYOV15]
        ,[TYOV16]
        ,[TYOV17]
        ,[TYOV18]
        ,[TYOV19]
        ,[TYOV20]
        ,[TYOV21]
        ,[TYOV22]
        ,[TYOV23]
        ,[TYOV24]
        ,[TYOV25]
        ,[TKMENO1]
        ,[TKMENO2]
        ,[TKMENO3]
        ,[TKMENO4]
        ,[TKMENO5]
        ,[TKMENO6]
        ,[TKMENO7]
        ,[TKMENO8]
        ,[TKMENO9]
        ,[TKMENO10]
        ,[TKMENO11]
        ,[TKMENO12]
        ,[TKMENO13]
        ,[TKMENO14]
        ,[TKMENO15]
        ,[TKMENO16]
        ,[TKMENO17]
        ,[TKMENO18]
        ,[TKMENO19]
        ,[TKMENO20]
        ,[TKMENO21]
        ,[TKMENO22]
        ,[TKMENO23]
        ,[TKMENO24]
        ,[TKMENO25]
        ,[TA1]
        ,[TA2]
        ,[TA3]
        ,[TA4]
        ,[TA5]
        ,[TA6]
        ,[TA7]
        ,[TA8]
        ,[TA9]
        ,[TA10]
        ,[TA11]
        ,[TA12]
        ,[TA13]
        ,[TA14]
        ,[TA15]
        ,[TA16]
        ,[TA17]
        ,[TA18]
        ,[TA1P]
        ,[TA2P]
        ,[TA3P]
        ,[TA4P]
        ,[TA5P]
        ,[TA6P]
        ,[TA7P]
        ,[TA8P]
        ,[TA9P]
        ,[TA10P]
        ,[TA11P]
        ,[TA12P]
        ,[TA13P]
        ,[TA14P]
        ,[TA15P]
        ,[TA16P]
        ,[TA17P]
        ,[TA18P]
        ,[tk_arvio]
        ,[tk_arvioe]
        ,[KMENO]
        ,[HMENO]
        ,[TUTLKM]
        ,[NTUTLKM]
        ,[TUTTTV]
        ,[MTKLKM]
        ,[NMTKLKM]
        ,[MTKTTV]
        ,[YHTE2]
        ,[NYHTE2]
        ,[MKOULKM]
        ,[NMKOULKM]
        ,[MKOUTTV]
        ,[OPISTLKM]
        ,[NOPISTLKM]
        ,[OPISTTTV]
        ,[KUNNAT]
        ,[MKVJ]
        ,[ORAHAS]
        ,[phy1]
        ,[phy2]
        ,[phy3]
        ,[phy4]
        ,[phy5]
        ,[phy6]
        ,[phyy]
        ,[phn1]
        ,[phn2]
        ,[phn3]
        ,[phn4]
        ,[phn5]
        ,[phn6]
        ,[phny]
        ,[pty1]
        ,[pty2]
        ,[pty3]
        ,[pty4]
        ,[pty5]
        ,[pty6]
        ,[ptyy]
        ,[ptn1]
        ,[ptn2]
        ,[ptn3]
        ,[ptn4]
        ,[ptn5]
        ,[ptn6]
        ,[ptny]
        ,[RKORK]=NULL
  	  ,[luontipvm]
  	  ,tieteenalakoodisto='TA10'
        ,[tietolahde]='TK_5_4_sopv_15_yosair'
        ,[rivinumero] = ROW_NUMBER() OVER(ORDER BY TK_Koodi)
    FROM [TK_H9098_CSC].[dbo].[TK_5_4_sopv_15_yosair]
  
  UNION ALL
  
  SELECT [tilv]
        ,[NIMI]
        ,[NIMI2]
        ,[TK_koodi]
        ,[TOLKM]
        ,[NTOLKM]
        ,[TOTTV]
        ,[LISLKM]
        ,[NLISLKM]
        ,[LISTTV]
        ,[DILKM]
        ,[NDIPLKM]
        ,[DIPTTV]
        ,[INSLKM]
        ,[NOPINS]
        ,[OPINSTTV]
        ,[YHTE]
        ,[NYHTE]
        ,[YHTTTV]
        ,[PAME]
        ,[OSTPAL]
        ,[YHME]
        ,[TEKES]
        ,[MTEM]
        ,[AKATEMIA]
        ,NULL AS [GRAD]
        ,[MOPEM]
        ,[LIIKM]
        ,[MAAM]
        ,[OM]
        ,[PM]
        ,[SISAM]
        ,[SOSM]
        ,[UM]
        ,[VN]
        ,[VM]
        ,[YMP]
        ,[MUUJU]
        ,[RAHAS]
        ,[KOTIM]
        ,[ULKOY]
        ,[UEU]
  	  ,[EUPUITE] = NULL
  	  ,[EAKR] = NULL
  	  ,[ESR] = NULL
  	  ,[MUUEU] = NULL
        ,[MULKO]
        ,[UYHTE]
        ,[KUNTA1]
        ,[KUNTA2]
        ,[KUNTA3]
        ,[KUNTA4]
        ,[KUNTA5]
        ,[KUNTA6]
        ,[KUNTA7]
        ,[KUNTA8]
        ,[KUNTA9]
        ,[KUNTA10]
        ,[KUNTA11]
        ,[KUNTA12]
        ,[KUNTA13]
        ,[KUNTA14]
        ,[KUNTA15]
        ,[KUNTA16]
        ,[KUNTA17]
        ,[KUNTA18]
        ,[KUNTA19]
        ,[KUNTA20]
        ,[KUNTA21]
        ,[KUNTA22]
        ,[KUNTA23]
        ,[KUNTA24]
        ,[KUNTA25]
        ,[HENLKMY]
        ,[TYOVY]
        ,[TKMENOY]
        ,[HENLKM1]
        ,[HENLKM2]
        ,[HENLKM3]
        ,[HENLKM4]
        ,[HENLKM5]
        ,[HENLKM6]
        ,[HENLKM7]
        ,[HENLKM8]
        ,[HENLKM9]
        ,[HENLKM10]
        ,[HENLKM11]
        ,[HENLKM12]
        ,[HENLKM13]
        ,[HENLKM14]
        ,[HENLKM15]
        ,[HENLKM16]
        ,[HENLKM17]
        ,[HENLKM18]
        ,[HENLKM19]
        ,[HENLKM20]
        ,[HENLKM21]
        ,[HENLKM22]
        ,[HENLKM23]
        ,[HENLKM24]
        ,[HENLKM25]
        ,[TYOV1]
        ,[TYOV2]
        ,[TYOV3]
        ,[TYOV4]
        ,[TYOV5]
        ,[TYOV6]
        ,[TYOV7]
        ,[TYOV8]
        ,[TYOV9]
        ,[TYOV10]
        ,[TYOV11]
        ,[TYOV12]
        ,[TYOV13]
        ,[TYOV14]
        ,[TYOV15]
        ,[TYOV16]
        ,[TYOV17]
        ,[TYOV18]
        ,[TYOV19]
        ,[TYOV20]
        ,[TYOV21]
        ,[TYOV22]
        ,[TYOV23]
        ,[TYOV24]
        ,[TYOV25]
        ,[TKMENO1]
        ,[TKMENO2]
        ,[TKMENO3]
        ,[TKMENO4]
        ,[TKMENO5]
        ,[TKMENO6]
        ,[TKMENO7]
        ,[TKMENO8]
        ,[TKMENO9]
        ,[TKMENO10]
        ,[TKMENO11]
        ,[TKMENO12]
        ,[TKMENO13]
        ,[TKMENO14]
        ,[TKMENO15]
        ,[TKMENO16]
        ,[TKMENO17]
        ,[TKMENO18]
        ,[TKMENO19]
        ,[TKMENO20]
        ,[TKMENO21]
        ,[TKMENO22]
        ,[TKMENO23]
        ,[TKMENO24]
        ,[TKMENO25]
        ,[TA1]
        ,[TA2]
        ,[TA3]
        ,[TA4]
        ,[TA5]
        ,[TA6]
        ,[TA7]
        ,[TA8]
        ,[TA9]
        ,[TA10]
        ,[TA11]
        ,[TA12]
        ,[TA13]
        ,[TA14]
        ,[TA15]
        ,[TA16]
        ,[TA17]
        ,[TA18]
        ,[TA1P]
        ,[TA2P]
        ,[TA3P]
        ,[TA4P]
        ,[TA5P]
        ,[TA6P]
        ,[TA7P]
        ,[TA8P]
        ,[TA9P]
        ,[TA10P]
        ,[TA11P]
        ,[TA12P]
        ,[TA13P]
        ,[TA14P]
        ,[TA15P]
        ,[TA16P]
        ,[TA17P]
        ,[TA18P]
        ,[tk_arvio]
        ,[tk_arvioe]
        ,NULL AS [KMENO]
        ,NULL AS [HMENO]
        ,NULL AS [TUTLKM]
        ,NULL AS [NTUTLKM]
        ,[TUTTTV]
        ,NULL AS [MTKLKM]
        ,NULL AS [NMTKLKM]
        ,[MTKTTV]
        ,NULL AS [YHTE2]
        ,NULL AS [NYHTE2]
        ,NULL AS [MKOULKM]
        ,NULL AS [NMKOULKM]
        ,NULL AS [MKOUTTV]
        ,NULL AS [OPISTLKM]
        ,NULL AS [NOPISTLKM]
        ,NULL AS [OPISTTTV]
        ,NULL AS [KUNNAT]
        ,NULL AS [MKVJ]
        ,NULL AS [ORAHAS]
        ,[phy1]
        ,[phy2]
        ,[phy3]
        ,[phy4]
        ,[phy5]
        ,[phy6]
        ,[phyy]
        ,[phn1]
        ,[phn2]
        ,[phn3]
        ,[phn4]
        ,[phn5]
        ,[phn6]
        ,[phny]
        ,[pty1]
        ,[pty2]
        ,[pty3]
        ,[pty4]
        ,[pty5]
        ,[pty6]
        ,[ptyy]
        ,[ptn1]
        ,[ptn2]
        ,[ptn3]
        ,[ptn4]
        ,[ptn5]
        ,[ptn6]
        ,[ptny]
        ,[RKORK],[luontipvm]
  	  ,tieteenalakoodisto='TA10'
        ,[tietolahde]='TK_5_4_sopv_16_yosair'
        ,[rivinumero] = ROW_NUMBER() OVER(ORDER BY TK_Koodi)
    FROM [TK_H9098_CSC].[dbo].[TK_5_4_sopv_16_yosair]
  
  UNION ALL
  
  SELECT [tilv]
        ,[NIMI]
        ,[NIMI2]
        ,[TK_koodi]
        ,[TOLKM]
        ,[NTOLKM]
        ,[TOTTV]
        ,[LISLKM]
        ,[NLISLKM]
        ,[LISTTV]
        ,[DILKM]
        ,[NDIPLKM]
        ,[DIPTTV]
        ,[INSLKM]
        ,[NOPINS]
        ,[OPINSTTV]
        ,[YHTE]
        ,[NYHTE]
        ,[YHTTTV]
        ,[PAME]
        ,[OSTPAL]
        ,[YHME]
        ,[TEKES]
        ,[MTEM]
        ,[AKATEMIA]
        ,NULL AS [GRAD]
        ,[MOPEM]
        ,[LIIKM]
        ,[MAAM]
        ,[OM]
        ,[PM]
        ,[SISAM]
        ,[SOSM]
        ,[UM]
        ,[VN]
        ,[VM]
        ,[YMP]
        ,[MUUJU]
        ,[RAHAS]
        ,[KOTIM]
        ,[ULKOY]
        ,[UEU]
  	  ,[EUPUITE] = NULL
  	  ,[EAKR] = NULL
  	  ,[ESR] = NULL
  	  ,[MUUEU] = NULL
        ,[MULKO]
        ,[UYHTE]
        ,[KUNTA1]
        ,[KUNTA2]
        ,[KUNTA3]
        ,[KUNTA4]
        ,[KUNTA5]
        ,[KUNTA6]
        ,[KUNTA7]
        ,[KUNTA8]
        ,[KUNTA9]
        ,[KUNTA10]
        ,[KUNTA11]
        ,[KUNTA12]
        ,[KUNTA13]
        ,[KUNTA14]
        ,[KUNTA15]
        ,[KUNTA16]
        ,[KUNTA17]
        ,[KUNTA18]
        ,[KUNTA19]
        ,[KUNTA20]
        ,[KUNTA21]
        ,[KUNTA22]
        ,[KUNTA23]
        ,[KUNTA24]
        ,[KUNTA25]
        ,[HENLKMY]
        ,[TYOVY]
        ,[TKMENOY]
        ,[HENLKM1]
        ,[HENLKM2]
        ,[HENLKM3]
        ,[HENLKM4]
        ,[HENLKM5]
        ,[HENLKM6]
        ,[HENLKM7]
        ,[HENLKM8]
        ,[HENLKM9]
        ,[HENLKM10]
        ,[HENLKM11]
        ,[HENLKM12]
        ,[HENLKM13]
        ,[HENLKM14]
        ,[HENLKM15]
        ,[HENLKM16]
        ,[HENLKM17]
        ,[HENLKM18]
        ,[HENLKM19]
        ,[HENLKM20]
        ,[HENLKM21]
        ,[HENLKM22]
        ,[HENLKM23]
        ,[HENLKM24]
        ,[HENLKM25]
        ,[TYOV1]
        ,[TYOV2]
        ,[TYOV3]
        ,[TYOV4]
        ,[TYOV5]
        ,[TYOV6]
        ,[TYOV7]
        ,[TYOV8]
        ,[TYOV9]
        ,[TYOV10]
        ,[TYOV11]
        ,[TYOV12]
        ,[TYOV13]
        ,[TYOV14]
        ,[TYOV15]
        ,[TYOV16]
        ,[TYOV17]
        ,[TYOV18]
        ,[TYOV19]
        ,[TYOV20]
        ,[TYOV21]
        ,[TYOV22]
        ,[TYOV23]
        ,[TYOV24]
        ,[TYOV25]
        ,[TKMENO1]
        ,[TKMENO2]
        ,[TKMENO3]
        ,[TKMENO4]
        ,[TKMENO5]
        ,[TKMENO6]
        ,[TKMENO7]
        ,[TKMENO8]
        ,[TKMENO9]
        ,[TKMENO10]
        ,[TKMENO11]
        ,[TKMENO12]
        ,[TKMENO13]
        ,[TKMENO14]
        ,[TKMENO15]
        ,[TKMENO16]
        ,[TKMENO17]
        ,[TKMENO18]
        ,[TKMENO19]
        ,[TKMENO20]
        ,[TKMENO21]
        ,[TKMENO22]
        ,[TKMENO23]
        ,[TKMENO24]
        ,[TKMENO25]
        ,[TA1]
        ,[TA2]
        ,[TA3]
        ,[TA4]
        ,[TA5]
        ,[TA6]
        ,[TA7]
        ,[TA8]
        ,[TA9]
        ,[TA10]
        ,[TA11]
        ,[TA12]
        ,[TA13]
        ,[TA14]
        ,[TA15]
        ,[TA16]
        ,[TA17]
        ,[TA18]
        ,[TA1P]
        ,[TA2P]
        ,[TA3P]
        ,[TA4P]
        ,[TA5P]
        ,[TA6P]
        ,[TA7P]
        ,[TA8P]
        ,[TA9P]
        ,[TA10P]
        ,[TA11P]
        ,[TA12P]
        ,[TA13P]
        ,[TA14P]
        ,[TA15P]
        ,[TA16P]
        ,[TA17P]
        ,[TA18P]
        ,[tk_arvio]
        ,[tk_arvioe]
        ,NULL AS [KMENO]
        ,NULL AS [HMENO]
        ,NULL AS [TUTLKM]
        ,NULL AS [NTUTLKM]
        ,[TUTTTV]
        ,NULL AS [MTKLKM]
        ,NULL AS [NMTKLKM]
        ,[MTKTTV]
        ,NULL AS [YHTE2]
        ,NULL AS [NYHTE2]
        ,NULL AS [MKOULKM]
        ,NULL AS [NMKOULKM]
        ,NULL AS [MKOUTTV]
        ,NULL AS [OPISTLKM]
        ,NULL AS [NOPISTLKM]
        ,NULL AS [OPISTTTV]
        ,NULL AS [KUNNAT]
        ,NULL AS [MKVJ]
        ,NULL AS [ORAHAS]
        ,[phy1]
        ,[phy2]
        ,[phy3]
        ,[phy4]
        ,[phy5]
        ,[phy6]
        ,[phyy]
        ,[phn1]
        ,[phn2]
        ,[phn3]
        ,[phn4]
        ,[phn5]
        ,[phn6]
        ,[phny]
        ,[pty1]
        ,[pty2]
        ,[pty3]
        ,[pty4]
        ,[pty5]
        ,[pty6]
        ,[ptyy]
        ,[ptn1]
        ,[ptn2]
        ,[ptn3]
        ,[ptn4]
        ,[ptn5]
        ,[ptn6]
        ,[ptny]
        ,[RKORK],[luontipvm]
  	  ,tieteenalakoodisto='TA10'
        ,[tietolahde]='TK_5_4_sopv_17_yosair'
        ,[rivinumero] = ROW_NUMBER() OVER(ORDER BY TK_Koodi)
    FROM [TK_H9098_CSC].[dbo].[TK_5_4_sopv_17_yosair]
  
  
  ) kaikkivuodet
  
  
  
  
  GO
  
  
  USE [ANTERO]