Remove duplicate data
Add two fields
Alter TABLE T_Employee Add FSubCompany VARchar (20 );
Alter table T_Employee ADD FDepartment VARCHAR (20 );
Assign values to newly added fields
UPDATE T_Employee SET FSubCompany = 'beijing', FDepartment = 'development 'where FNumber = 'dev001 ';
UPDATE T_Employee SET FSubCompany = 'shenzhen', FDepartment = 'development 'where FNumber = 'dev002 ';
UPDATE T_Employee SET FSubCompany = 'beijing', FDepartment = 'humanresource' where FNumber = 'hr001 ';
UPDATE T_Employee SET FSubCompany = 'beijing', FDepartment = 'humanresource' where FNumber = 'hr002 ';
UPDATE T_Employee SET FSubCompany = 'beijing', FDepartment = 'infotech 'where FNumber = 'it001 ';
UPDATE T_Employee SET FSubCompany = 'shenzhen', FDepartment = 'infotech 'where FNumber = 'it002 ';
UPDATE T_Employee SET FSubCompany = 'beijing', FDepartment = 'sales' where FNumber = 'sales001 ';
UPDATE T_Employee SET FSubCompany = 'beijing', FDepartment = 'sales' where FNumber = 'sales002 ';
UPDATE T_Employee SET FSubCompany = 'shenzhen', FDepartment = 'sales' where FNumber = 'sales003 ';
Query and remove duplicates
Select distinct FDepartment from T_Employee
Select distinct FDepartment, FSubCompany from T_Employee