Q: How can I insert query value to the column with existing data? I want to insert this query into the new column and below is my query:
INSERT INTO T_SG_WICA_POL_DATA (SubClassGroup)
SELECT M.[Subclass_Main] 
FROM [WICA subclass mapping] AS M
LEFT JOIN T_SG_WICA_TRANSACTION_VIEW ON M.[Subclass Code] = Subclass;

But I received this error when trying to run it:

Cannot insert the value NULL into column 'AccountTenure', table 'analytics.dbo.T_SG_WICA_POL_DATA'; column does not allow nulls. INSERT fails.`

I want to insert to SubClassGroup column not AccountTenure column so I'm not sure why I get this error and how can I insert the value to SubClassGroup column?

A: By starting the query with INSERT INTO you are telling the system to insert an entirely new row in the table. You would need to provide a value for at least every column that does not define a default or auto increment value and that is not nullable.
INSERT INTO T_SG_WICA_POL_DATA (SubClassGroup, AccountTenure, ...)
SELECT M.Subclass_Main, M.AccountTenure, ... 
FROM [WICA subclass mapping] AS M

If you want to update the value of one or more columns in one or more existing table rows you can use an update query:
UPDATE T_SG_WICA_POL_DATA SET SubClassGroup = M.Subclass_Main --, AccountTenure = M.AccountTenure, ...
FROM WICA subclass mapping AS M
JOIN T_SG_WICA_TRANSACTION_VIEW AS T ON M.[Subclass Code] = T.Subclass
--WHERE some_other_condition

Note that I changed the left join into a regular join since a left join will not add any constraints to the query, causing the update to apply to all rows instead of only the ones where a record is present in T_SG_WICA_TRANSACTION_VIEW with a matching Subclass code.
