Equals(=) vs. LIKE

后端 未结 15 2269
情书的邮戳
情书的邮戳 2020-11-22 15:19

When using SQL, are there any benefits of using = in a WHERE clause instead of LIKE?

Without any special operators, LIKE

15条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 15:42

    LIKE and = are different. LIKE is what you would use in a search query. It also allows wildcards like _ (simple character wildcard) and % (multi-character wildcard).

    = should be used if you want exact matches and it will be faster.

    This site explains LIKE

提交回复
热议问题