

INSERT INTO customer_treatment_groups_v2
           (tenant_no
           ,pos_cd
           ,treatment_id
           ,treatment_group_id
		   ,customer_treatment_group_id
           ,company_no
           ,employee_no
           ,employee_nm
           ,operating_employee_no
           ,operating_employee_nm
           ,comment)
    SELECT tenant_no
      ,pos_cd
      ,treatment_id
      ,treatment_group_id
	  ,1
      ,company_no
      ,employee_no
      ,employee_nm
      ,operating_employee_no
      ,operating_employee_nm
      ,comment
  FROM customer_treatment_groups;

    
INSERT INTO customer_treatment_group_fields_v2
           (tenant_no
      ,pos_cd
      ,treatment_id
      ,treatment_group_id
	  ,customer_treatment_group_id
      ,treatment_group_field_id
      ,treatment_group_field_value)
    SELECT tenant_no
      ,pos_cd
      ,treatment_id
      ,treatment_group_id
	  ,1
      ,treatment_group_field_id
      ,treatment_group_field_value
  FROM customer_treatment_group_fields;

DELETE FROM customer_treatment_group_fields;
DELETE FROM customer_treatment_groups;
