The forum will be down for maintenance at some point from Friday, November 16 at 19:00 EDT until Sunday, November 18 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.

I have some sql like

Select * 
from bti.table
field between start and stop
and field1 is null
and (field2 like 'HH%' or field2 like 'HS%' or field2 like 'SS%')

I only get results like HH%. What gives? Is there an alternate way to do this? I could make 3 separate queries and combine the results but that would be slow and clunky.

version is


asked 29 Aug, 14:31

josephcraw's gravatar image

accept rate: 100%

edited 29 Aug, 15:16

I cannot reproduce that behavior. Please confirm the version and build you are testing. I tested the following query against the demo database:

select * from employees where StartDate between '1900-01-01' and '2019-01-10' and TerminationDate is null and (City like 'CH%' or City like 'CO%' or City like 'WA%')

In the results, I get the following cities: Charlottetown, Cornwall, Wakefield, Waterdown, and Waterloo

(29 Aug, 14:51) Chris Keating

version is

(29 Aug, 15:16) josephcraw

I'm an idiot. The issue was there was nothing that met the criteria for the other likes. Sorry

permanent link

answered 29 Aug, 15:25

josephcraw's gravatar image

accept rate: 100%


Don't worry about it... you did the right thing by posting a question, sometimes that's the path to epiphany :)

(29 Aug, 16:11) Breck Carter
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 29 Aug, 14:31

question was seen: 146 times

last updated: 29 Aug, 16:12