May 23, 2022 at 1:38 pm
What do you mean by "sticks" in this question? There is nothing in you question or the DDL or data to explain that.
May 23, 2022 at 1:53 pm
the OP means the pipe "|" between strings
May 23, 2022 at 2:12 pm
Sticks = pipes ("|"). Thank you, Frederico! I guess I have heard that term, but not as commonly as pipe, and didn't make the connection here.
Ahmed: Questions --
If you must split-out delimited lists (e.g, that's how a vendor sends the data), use the STRING_SPLIT function, which will turn the list into a table-valued-variable.
May 23, 2022 at 3:10 pm
Your structure should be normalized, as you stated.
create table #countries
(
company int,
[year] int,
rev int,
country_sequence smallint,
country varchar(100)
)
(12011,2010,121,1,'Egypt')
(12011,2010,121,2,'France')
,,,
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
May 23, 2022 at 6:14 pm
my key is company and year and rev and not repeated
What, from your example code, would constitute "repeating data"? If the answer is "none of it", then we need an example of what would constitute "repeating data", please.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply