Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Apr 20, 1997

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 you perform this operation, there is nothing in standard SQL that will help.

If the columns were exactly the same length, you could use a substring function to pull out each component. You would have to check your particular server's documentation on the availability of text functions since each product varies.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date