SELECT
	*
FROM
	dbo.email_notification
WHERE
  email_to LIKE 'rindu%'
  --email_cc = 'achmad.syarifuddin@equity.co.id; liana.dewi@equity.co.id; fattydh@equity.co.id; yosep.pernandos@equity.co.id'
 
--UPDATE dbo.email_notification SET email_to='nurfadillah.hannum@equity.id' WHERE email_to='nurfadillah.hannum@equity.co.id'

--UPDATE dbo.email_notification SET email_cc = 'monika.sari@equity.id; yosep.pernandos@equity.id' WHERE email_cc = 'monika.sari@equity.co.id; yosep.pernandos@equity.co.id'

--UPDATE dbo.email_notification SET id_transaction_type=5, id_unit_pelayanan_create=NULL WHERE id_email_notification=15
--UPDATE dbo.email_notification SET id_transaction_type=41, id_unit_pelayanan_create=NULL WHERE id_email_notification=60
--UPDATE dbo.email_notification SET id_transaction_type=35, id_unit_pelayanan_create=NULL WHERE id_email_notification=18
--UPDATE dbo.email_notification SET id_transaction_type=43, id_unit_pelayanan_create=NULL WHERE id_email_notification=19
--UPDATE dbo.email_notification SET id_transaction_type=44, id_unit_pelayanan_create=NULL WHERE id_email_notification=20
--UPDATE dbo.email_notification SET id_transaction_type=38, id_unit_pelayanan_create=NULL WHERE id_email_notification=21
--UPDATE dbo.email_notification SET id_transaction_type=26, id_unit_pelayanan_create=NULL WHERE id_email_notification=22
--UPDATE dbo.email_notification SET id_transaction_type=31, id_unit_pelayanan_create=NULL WHERE id_email_notification=23
--UPDATE dbo.email_notification SET id_transaction_type=33, id_unit_pelayanan_create=NULL WHERE id_email_notification=24
--UPDATE dbo.email_notification SET id_transaction_type=36, id_unit_pelayanan_create=NULL WHERE id_email_notification=25
--UPDATE dbo.email_notification SET id_transaction_type=39, id_unit_pelayanan_create=NULL WHERE id_email_notification=26
--UPDATE dbo.email_notification SET id_transaction_type=40, id_unit_pelayanan_create=NULL WHERE id_email_notification=93
--UPDATE dbo.email_notification SET id_transaction_type=27, id_unit_pelayanan_create=NULL WHERE id_email_notification=100
--UPDATE dbo.email_notification SET id_transaction_type=30, id_unit_pelayanan_create=NULL WHERE id_email_notification=107
--UPDATE dbo.email_notification SET id_transaction_type=34, id_unit_pelayanan_create=NULL WHERE id_email_notification=114
--UPDATE dbo.email_notification SET id_transaction_type=42, id_unit_pelayanan_create=NULL WHERE id_email_notification=121
--UPDATE dbo.email_notification SET id_transaction_type=17, id_unit_pelayanan_create=NULL WHERE id_email_notification=128
----UPDATE dbo.email_notification SET id_transaction_type=20, id_unit_pelayanan_create=NULL WHERE id_email_notification=31
--DELETE FROM dbo.email_notification WHERE id_email_notification IN (61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,97,98,104,105,111,112,118,119,125,126,132,133,139,140,146,147,153,154,160,161,167,168,174,175,181,
--182,
--188,
--189,
--195,
--196,
--202,
--203,
--209,
--210,
--216,
--217,
--223,
--224,
--230,
--231)

--16,38,19,18,21,20
SELECT
	*
FROM
	dbo.transaction_type
ORDER BY
  description

--10
--11
--15

--INSERT INTO dbo.email_notification
--        (id_transaction_type,
--         id_unit_pelayanan_create,
--         email_to,
--         email_cc,
--         status,
--         create_by,
--         create_date,
--         change_by,
--         change_date)
--VALUES
--        (14, -- id_transaction_type - tinyint
--         NULL, -- id_unit_pelayanan_create - varchar(50)
--         'liana.dewi@equity.id', -- email_to - varchar(400)
--         'achmad.syarifuddin@equity.id; liana.dewi@equity.id; monika.sari@equity.id; yosep.pernandos@equity.id', -- email_cc - varchar(300)
--         'I', -- status - varchar(1)
--         'SUP', -- create_by - varchar(4)
--         GETDATE(), -- create_date - datetime
--         NULL, -- change_by - varchar(4)
--         NULL  -- change_date - datetime
--         )

SELECT
	*
FROM
	dbo.email_notification
WHERE
  id_transaction_type IN (10,
26,
28,
31,
32,
29,
33,
36,
37,
35,
19,
18,
21,
20,
38,
39,
40,
27,
41,
9,
42,
11,
30,
34,
17,
13,
12,
15,
44,
43,
45,
14,
8,
16,
5,
3)
ORDER BY
  email_to

-- hapus
--DELETE
--FROM
--	dbo.email_notification
--WHERE
--  id_email_notification IN (
--225,
--218,
--211,
--204,
--197,
--190,
--183,
--176,
--169,
--5,
--6,
--7,
--8,
--9,
--10,
--11,
--12,
--13,
--14,
--134,
--127,
--120,
--162,
--155,
--148,
--141,
--106,
--113,
--92,
--99,
--37,
--95,
--96,
--102,
--103,
--109,
--110,
--116,
--117,
--123,
--124,
--130,
--131,
--137,
--138,
--144,
--145,
--151,
--152,
--158,
--159,
--38,
--39,
--40,
--41,
--42,
--43,
--44,
--45,
--46,
--47,
--49,
--50,
--51,
--52,
--53,
--54,
--55,
--56,
--57,
--58,
--59,
--165,
--166,
--172,
--173,
--179,
--180,
--186,
--187,
--193,
--194,
--200,
--201,
--207,
--208,
--214,
--215,
--228,
--229,
--221,
--222)


SELECT
  --en.id_email_notification,
  --en.id_transaction_type,
  tt.description,
  en.id_unit_pelayanan_create,
  en.email_to,
  en.email_cc,
  en.status,
  en.create_by,
  en.create_date,
  en.change_by,
  en.change_date
FROM
	dbo.email_notification AS en LEFT JOIN
	dbo.transaction_type AS tt ON en.id_transaction_type = tt.id_transaction_type
ORDER BY
  en.email_to,
  tt.description

--UPDATE dbo.email_notification SET email_to='darwindo@equity.id; henny@equity.id' WHERE email_to='darwindo@equity.co.id; hanni.abdullah@equity.co.id'
--UPDATE dbo.email_notification SET email_cc='achmad.syarifuddin@equity.id; elysabeth@equity.id; monika.sari@equity.id; yosep.pernandos@equity.id' WHERE email_cc='achmad.syarifuddin@equity.co.id; elysabeth@equity.co.id; fattydh@equity.co.id; yosep.pernandos@equity.co.id'
