Equals(=) vs. LIKE

后端 未结 15 2331
情书的邮戳
情书的邮戳 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:44

    Really it comes down to what you want the query to do. If you mean an exact match then use =. If you mean a fuzzier match, then use LIKE. Saying what you mean is usually a good policy with code.

提交回复
热议问题