MySQL Wildcards * and %

后端 未结 2 1000
感情败类
感情败类 2020-12-03 03:15

What is the difference between % and * wildcards in MySQL?

In a query like so : \"SELECT * FROM $table WHERE MATCH (message) AGAINST(

相关标签:
2条回答
  • 2020-12-03 03:21

    "An asterisk is the truncation operator. Unlike the other operators, it is appended to the word, or fragment, not prepended."

    This only applies to MATCH() ... AGAINST() statements.

    The % is a LIKE wildcard and has nothing to do with the MATCH() ... AGAINST().

    I hope that helps.

    0 讨论(0)
  • 2020-12-03 03:36

    * can only be used as a wildcard (or truncation) in a full text search while % (match 0 or more characters) and _ (match exactly one character) are only applicable in LIKE-queries.

    0 讨论(0)
提交回复
热议问题