0

I am trying to execute the following:

Where Column_1 in ( (like '[BRCD]%'), 'J68', 'ESB')

So what I was trying to achieve was all values will be shown with the following letters: B,R,C or D (Please note the characters following behind those letters will be numbers) and then I wanted it to search for specific values as well J68 and ESB but SQL doesn't like this and I can't seem to get it to display the set of data that I would like.

duncan
  • 1,161
  • 8
  • 14
Jaysorn
  • 1
  • 1
  • 5
    separate LIKE with RegEx and OR in – techspider Aug 16 '16 at 16:01
  • 6
    to elaborate on @techspider where Column_1 in('J68','ESB') or Column_1 LIKE '[BRCD]%' – S3S Aug 16 '16 at 16:03
  • 1
    Possible duplicate of [Is there a combination of "LIKE" and "IN" in SQL?](http://stackoverflow.com/questions/3014940/is-there-a-combination-of-like-and-in-in-sql) – Sander Aug 17 '16 at 09:45

1 Answers1

0

You cannot mix like that

Where Column_1 in ('J68', 'ESB')
   or Column_1 like '[BRCD]%' 

If you need more like then you need more or

scsimimon had this as a comment but it is an answer

paparazzo
  • 44,497
  • 23
  • 105
  • 176