If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I have a database that I need to get information from. However, one of the fields have been used for what should just be a product name,but it has, Product Name, Size, Strength I need each of these fields to be separate field. How can I extract the data with a SQL query with each field becoming it's own they are separated by a space. Is it possible? Any ideas? I am using MYSql to query the data
SELECT SUBSTRING_INDEX(field,' ',1) AS product_name
, SUBSTRING_INDEX(SUBSTRING_INDEX(field,' ',2),' ',-1) AS size
, SUBSTRING_INDEX(SUBSTRING_INDEX(field,' ',3),' ',-1) AS strength
FROM ...