1

Why does this LIKE-statement

WHERE configuration_key LIKE 'MODULE_SHIPPING_DP_%'

shows results like this:

MODULE_SHIPPING_DPD_STATUS
MODULE_SHIPPING_DP_STATUS
MODULE_SHIPPING_DPD_TAX_CLASS
MODULE_SHIPPING_DP_TAX_CLASS

I only wanted to get results with

MODULE_SHIPPING_DP_foobar

I dind't get it.

Cœur
  • 37,241
  • 25
  • 195
  • 267
user1286819
  • 101
  • 1
  • 9

2 Answers2

2

Because underscore _ is like the % except you only look for one character (cf documentation)

You need to escape the character by using \ before like this :

WHERE configuration_key LIKE 'MODULE\_SHIPPING\_DP\_%'
DessDess
  • 787
  • 1
  • 6
  • 20
1

_ is also a wildcard, matching one character. So you need to escape it.

WHERE configuration_key LIKE 'MODULE\_SHIPPING\_DP\_%'
James Scholes
  • 7,686
  • 3
  • 19
  • 20