--select 'Update prm_mst set prm_mst_freq_code = '''+case when [UPDATED FREQ] = '1' then '1Y' else '6M' end +''' where site_cd = ''H07'' and prm_mst_assetno = '''+[Asset No]+''' and prm_mst_pm_no = '''+prm_mst_pm_no+'''', *
--from [0 Nurlaili Ipoh], prm_mst
--where [0 Nurlaili Ipoh].[Asset No] = prm_mst.prm_mst_assetno
--and [UPDATED FREQ] is not null
--order by 4
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100613' and prm_mst_pm_no = 'PRM100986'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100614' and prm_mst_pm_no = 'PRM100987'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100615' and prm_mst_pm_no = 'PRM100988'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100616' and prm_mst_pm_no = 'PRM100989'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100617' and prm_mst_pm_no = 'PRM100990'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100618' and prm_mst_pm_no = 'PRM100991'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100619' and prm_mst_pm_no = 'PRM100992'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100620' and prm_mst_pm_no = 'PRM100993'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100621' and prm_mst_pm_no = 'PRM100994'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100622' and prm_mst_pm_no = 'PRM100995'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100623' and prm_mst_pm_no = 'PRM100996'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100609' and prm_mst_pm_no = 'PRM100982'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100610' and prm_mst_pm_no = 'PRM100983'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100611' and prm_mst_pm_no = 'PRM100984'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100625' and prm_mst_pm_no = 'PRM100998'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100626' and prm_mst_pm_no = 'PRM100999'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100627' and prm_mst_pm_no = 'PRM101000'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100628' and prm_mst_pm_no = 'PRM101001'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100629' and prm_mst_pm_no = 'PRM101002'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100934' and prm_mst_pm_no = 'PRM101288'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100935' and prm_mst_pm_no = 'PRM101289'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100937' and prm_mst_pm_no = 'PRM101291'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100939' and prm_mst_pm_no = 'PRM101293'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100940' and prm_mst_pm_no = 'PRM101294'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100941' and prm_mst_pm_no = 'PRM101295'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100943' and prm_mst_pm_no = 'PRM101297'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100945' and prm_mst_pm_no = 'PRM101299'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100946' and prm_mst_pm_no = 'PRM101300'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100948' and prm_mst_pm_no = 'PRM101302'
Update prm_mst set prm_mst_freq_code = '1Y' where site_cd = 'H07' and prm_mst_assetno = 'H07B100955' and prm_mst_pm_no = 'PRM101309'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100956' and prm_mst_pm_no = 'PRM101310'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100949' and prm_mst_pm_no = 'PRM101303'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100951' and prm_mst_pm_no = 'PRM101305'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100952' and prm_mst_pm_no = 'PRM101306'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100953' and prm_mst_pm_no = 'PRM101307'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100954' and prm_mst_pm_no = 'PRM101308'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100947' and prm_mst_pm_no = 'PRM101301'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100938' and prm_mst_pm_no = 'PRM101292'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100630' and prm_mst_pm_no = 'PRM101003'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100612' and prm_mst_pm_no = 'PRM100985'
Update prm_mst set prm_mst_freq_code = '6M' where site_cd = 'H07' and prm_mst_assetno = 'H07B100624' and prm_mst_pm_no = 'PRM100997'

