2

I want to return rows of data if in one column there are certain characters. So the row would return if in the specified column there was one of two sets of characters that i'd specified. I have used the following but it doesn't recognize the second variable:

"Title" LIKE 'Digi%' or 'Title' LIKE 'Brand%'

Is it possible to return results in this way?

Mureinik
  • 297,002
  • 52
  • 306
  • 350
Thomas Sharp
  • 121
  • 1
  • 9

2 Answers2

7

You're using single quotes ('), which are used to denote character literals, not column names. Columns can be denoted as bare strings:

Title LIKE 'Digi%' or Title LIKE 'Brand%'
Mureinik
  • 297,002
  • 52
  • 306
  • 350
1
WHERE CONTAINS(Title , '"Digi*" OR "Brand*"')
Matt
  • 14,906
  • 27
  • 99
  • 149
  • Eh? What's this supposed to be? – Strawberry Nov 06 '14 at 16:32
  • The only function I see in the [MySQL 5.7 Manual](https://dev.mysql.com/doc/refman/5.7/en/dynindex-function.html#function-index-C) for `Contains` has to do with spatial geometry type stuff. Are you sure this is correct? – Jeff B Nov 06 '14 at 17:23
  • http://stackoverflow.com/questions/3014940/is-there-a-combination-of-like-and-in-in-sql – Matt Nov 07 '14 at 08:14