MySQL Where condition replacement question?

Source: Internet
Author: User
Field: Ariclecategory/index?type=article

Value: Ariclecategory/index

Need: Compare? Previous self-read content and values are equal

Want every query, will include say hello to the content to remove in comparison, how to write where?

Current: SELECT * from where ziduan = ' ariclecategory/index ';

Reply content:

Field: Ariclecategory/index?type=article

Value: Ariclecategory/index

Need: Compare? Previous self-read content and values are equal

Want every query, will include say hello to the content to remove in comparison, how to write where?

Current: SELECT * from where ziduan = ' ariclecategory/index ';

select * from where ziduan like 'ariclecategory/index%'

Ariclecategory/index if it is a variable, replace it with a variable
The like that the prefix matches is available for indexing. Suffix matching and fuzzy matching are not available.

SELECT * from where Ziduan like ' ariclecategory/index% '? I don't know what that means.

Get rid of the question mark. This kind of data processing is done in the program, and the SQL where is as you write now.

  • 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.