devxlogo

Stripping concatenated fields

Stripping concatenated fields

Question:
I have a table that contains a concatenated field delimited by colons. The field contains approximately six values I want to house as separate columns on the table. How can I strip the concatenated field into the individual values and add them as columns to the table?

Answer:
Unless the columns happen to have exactly the same length every time youperform this operation, there is nothing in standard SQL that will help.

If the columns were exactly the same length, you could use a substringfunction to pull out each component. You would have to check yourparticular server’s documentation on the availability of text functionssince each product varies.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist