I work on sql server 2017 i have table data as below
i need to make design for data to be best practise and prevent repeating data
my issue here on column countries have data separated sticks so how to handle that
my key is company and year and rev and not repeated
so How to handle sticks on column countries
which design will be good for prevent sticks
What I have tried:
create table #countriesData
(
company int,
[Year] int,
rev int,
countries varchar(500)
)
insert into #countriesData(company,[Year],rev,countries)
values
(12011,2010,121,'Egypt|France|America'),
(12011,2011,121,'Egypt|Canda|America'),
(12011,2012,121,'China|Canda|America'),
(12099,2010,121,'SaudiArabia|France|America'),
(12099,2011,121,'Egypt|Canda|German'),
(12099,2012,121, 'China|Italy|America')