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

  • SEARCH
  • Home
  • 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 8923877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:15:02+00:00 2026-06-15T07:15:02+00:00

My db is built as follows: value1,value2,value3 | 1 value4,value5,valu6 | 2 value 5,

  • 0

My db is built as follows:

  1. value1,value2,value3 | 1
  2. value4,value5,val”u6 | 2
  3. value 5, value 6, value 8 |3

(Two columns, one with a key separated by commas and the other just a normal var-char)

I’m looking for the most reliable way to find a query within the quotes and I’m getting kinda lost here.

I’m using the word boundaries for that:

SELECT * FROM ABC WHERE content REGEXP '[[:<:]]value 5[[:>:]]'

The problem is when I’m doing this query:

SELECT * FROM ABC WHERE content REGEXP '[[:<:]]5[[:>:]]'

It will also return the value, which is not what I’m looking for. Another problem is that the word boundaries refer to quotes as a word boundary

How can I solve this and create a simple query that will only fetch the exact full query between the quotes?

BTW
I don’t have an option to change the DB structure…

  • 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-15T07:15:03+00:00Added an answer on June 15, 2026 at 7:15 am

    As @MarcB commented, you really should try to normalise your schema:

    CREATE TABLE ABC_values (
      id  INT,
      content VARCHAR(10),
      FOREIGN KEY (id) REFERENCES ABC (id)
    );
    
    INSERT INTO ABC_values
      (id, content)
    VALUES
      (1, 'value1'), (1, 'value2'), (1, 'value3'),
      (2, 'value4'), (2, 'value5'), (2, 'val"u6'),
      (3, 'value 5'), (3, 'value 6'), (3, 'value 8')
    ;
    
    ALTER TABLE ABC DROP content;
    

    Then, as required, you can perform a SQL join between your tables and group the results:

    SELECT   id, GROUP_CONCAT(ABC_values.content) AS content
    FROM     ABC LEFT JOIN ABC_values USING (id) NATURAL JOIN (
      SELECT id FROM ABC_values WHERE content = 'value 5'
    ) t
    GROUP BY id
    

    If it is completely impossible to change the schema, you can try FIND_IN_SET():

    SELECT * FROM ABC WHERE FIND_IN_SET('value 5', content)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an editor that built as follows: EditorBuilder builder = context.Html.Telerik().Editor() .Name(ID) .Encode(false)
I have a models for a user built form as follows: Form id title
Is there a good built-in way that I can find whether value is a
I have two PHP arrays. One contains a group name and another contains a
So, Here is my scenario: I have two activity and one service --> all
I create a custom right view as follows: // Build the Segmented Control NSArray
What's the difference of pData1 and pData2, which are build as follows: pData1 =
I need to build some client side code which follows this use case: An
I'm trying to build a right box who follows the user scrolling: CSS: .clearfix:after
Built a theme in HTML/CSS and customized a the cycle plugin to be a

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.