I have some sql like Select * from bti.table where 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 16.0.0.2213 thanks asked 29 Aug '18, 14:31 josephcraw |
I'm an idiot. The issue was there was nothing that met the criteria for the other likes. Sorry answered 29 Aug '18, 15:25 josephcraw 1
Don't worry about it... you did the right thing by posting a question, sometimes that's the path to epiphany :)
(29 Aug '18, 16:11)
Breck Carter
|
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
version is 16.0.0.2213