Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8064459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:22:13+00:00 2026-06-05T11:22:13+00:00

I have a column and I want to create a query to have multiple

  • 0

I have a column and I want to create a query to have multiple columns.

For example, I have test column.

The data of this column looks like this:

record1 => **option1|value1;option2|value2**
record2 => **option3|value3**
record3 => **option3|value3;option1|value1;option2|value2;option4|value4**

The number of options and values are undefined.

I want to have this one test column break into number of option like this :

option1   option2   option3  option4
'value1'  'value2'  'value3'  
                    'value3'
'value1'  'value2'  'value3' 'value4'

my table like this :

    id  name    options
    1   name    age|12;color|red;active|yes;car|no
    2   name    age|15;member|yes

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:22:16+00:00Added an answer on June 5, 2026 at 11:22 am

    You can write a custom MySQL function called user defined function that can receive the variable name and the value to search for and then return the row or ID etc. as you need.

    In that function, you will need to loop through all the rows in a read only cursor and use SUBSTRING_INDEX() to get the values separately and check for the match.

    If you need further assistance then let me know.

    For more info look into the MySQL manual for string functions here.

    An extract from a user comment from the above link that might help you write the function:
    This will split an IP address (“a.b.c.d”) into 4 respective octets:

    SELECT
    `ip` , 
    SUBSTRING_INDEX( `ip` , '.', 1 ) AS a,
    SUBSTRING_INDEX(SUBSTRING_INDEX( `ip` , '.', 2 ),'.',-1) AS b, 
    SUBSTRING_INDEX(SUBSTRING_INDEX( `ip` , '.', -2 ),'.',1) AS c,
    SUBSTRING_INDEX( `ip` , '.', -1 ) AS d
    FROM log_table
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have query that looks like this declare @tmpTable Table(id int) insert into @tmpTable(id)
I have a LINQ query that searches for multiple keywords on multiple columns. The
I have a table that has two columns, ID and Value. For this example
My django model looks like this: class Entity(models.Model): name = models.CharField(max_length=40) examples = models.ManyToManyField(Example,
I have a table with a row that looks like this: ( 20091231 48498429,
I have a database storing multiple columns and I am trying to create efficient
I have the following query: $query = Doctrine_Query::create() ->from('Member m') ->where(m.type='1') ->andWhere(m.name LIKE '%$term%')
If i have a view that generates multiple columns: CREATE VIEW dbo.foo AS SELECT
I have created a gridview with a column of checkboxes. I want the user
I really want to have a column of inifinite length for one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.