PHP MySQL Find a string in the linked fields bit

Source: Internet
Author: User
Tags php mysql
Please ask the hypothesis that I want to find a string of linked fields bits in MySQL
Which function should I use?
Like saying
"Owogkwoeag Wegaweogkawoeg" "Owogkwwegawegoeag Wegaweogkawoeg" "Owogkwesseseryeag" Wegaweogkawoeg "I'm looking for 190.
As long as I have 190, I'll delete him.
It's only 190.
If 19 or 910 or 91 does not count ....

Reply content:

Please ask the hypothesis that I want to find a string of linked fields bits in MySQL
Which function should I use?
Like saying
"Owogkwoeag Wegaweogkawoeg" "Owogkwwegawegoeag Wegaweogkawoeg" "Owogkwesseseryeag" Wegaweogkawoeg "I'm looking for 190.
As long as I have 190, I'll delete him.
It's only 190.
If 19 or 910 or 91 does not count ....

If you don't want to use LIKE a fuzzy query, you can use the LOCATE() or POSITION() function to implement it.

Let's say your table test is:

ID content
1 Owogkwoeag Wegaweogkawoeg
2 Owogkwwegawegoeag Wegaweogkawoeg
3 Owogkwesseseryeag Wegaweogkawoeg
4 Qweqweqweqweqwe 901

You can use the following statement to delete test content all records in a table that contain a column:

delete from test where LOCATE('190', content);

Or

delete from test where POSITION('190' IN content);
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.