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 8129199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:12:45+00:00 2026-06-06T08:12:45+00:00

I asked this question earlier: How to get delta between two text items But

  • 0

I asked this question earlier:

How to get delta between two text items

But I also need a more binary answer. That is, is there a way to tell if one text entry contains another. Again the example:

This is a line.

and

This is a line.  And another.

Is there a simple way in MySQL to tell the first is contained in the second? Both of these items are entries in a column that is of type text.

UPDATE:

My table looks like this

id INT,
mytext text

So, what I’d REALLY like to do is write a query that answers the following question:

Find all records in this table where mytext is contained in mytext_for_another_record where id=SOMENUMBER.

Maybe better put:
Find all records where id=123 and mytext(for id 123) is contained in the record.

So I’m scanning the entire table for records that contain the text for the entry where id=123.

Example data:

id | text

1 | this is a line
2 | this is a line and here is another
3 | random
4 | random this is a line

Now, rather than short text entries, suppose the text was VERY long, like 1000 characters. Suppose I wanted to find all records in the database that contained the text that was in record 1. Is the only way to do so to say LIKE '%this is a line%' ? Is there a way to look by giving the id of the record?

  • 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-06T08:12:48+00:00Added an answer on June 6, 2026 at 8:12 am

    Check INSTR(haystack, needle) function, and compare it to 0. If 0, haystack does not contain needle. You could also do it with LIKE operator and wildcards (%), but you’d have to escape the % signs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this question was asked earlier but the OP didn't get any
I asked this question earlier. I am intrigued by std::set but I have another
This question was asked earlier by someone else but never answered: MKAnnotation - Map
I've asked about this earlier but the question itself and all the information in
I asked this question earlier but I was very vague and a lot of
(I asked this question earlier, but had forgotten to mention some constraints. This is
I asked a question earlier on this same project but I'm still having issues
I know this question has been asked, but I can't find more than one
I know I have asked this question in a different manner earlier today but
This question is related to my earlier question, asked here: How do I get

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.