By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE PersonsInitial (
tel int,
firstname varchar(255),
lastname varchar(255),
Customer_ID varchar(255)
);
insert into PersonsInitial(tel,firstname,lastname,Customer_ID) values
('01234','Manu','Johns','456'),
('01234','Manu','Johns','C456'),
('21234','Fernand','Wajk','C389'),
('13554','Mathieu','Wainers','4683');
select distinct tel, firstname, lastname, customer_id from PersonsInitial
--if there is a person with the same tel number chose the customer id with 'C'
--if I don't have the choice add the customer without C
CREATE TABLE PersonsFinal (
tel int,
firstname varchar(255),
lastname varchar(255),
Customer_ID varchar(255)
);
insert into PersonsFinal(tel,firstname,lastname,Customer_ID) values
('01234','Manu','Johns','C456'),
('21234','Fernand','Wajk','C389'),
('13554','Mathieu','Wainers','4683');
select distinct tel, firstname, lastname, customer_id from PersonsFinal
tel | firstname | lastname | customer_id |
---|---|---|---|
1234 | Manu | Johns | 456 |
1234 | Manu | Johns | C456 |
13554 | Mathieu | Wainers | 4683 |
21234 | Fernand | Wajk | C389 |
tel | firstname | lastname | customer_id |
---|---|---|---|
1234 | Manu | Johns | C456 |
13554 | Mathieu | Wainers | 4683 |
21234 | Fernand | Wajk | C389 |