Subject | Re: [firebird-support] between operator on a varchar field |
---|---|
Author | Ivan_P=c5=99enosil |
Post date | 2017-03-31T12:08:03Z |
> I have a query with a between operator on a non-indexed varchar(30)field – currently on FB 2.5 :
>the resultset ( so I have to put other criteria e.g. and MYFIELD like
> … where MYFIELD between ’AHH00091/2017’ and ’AHH00141/2017’
>
> I would expect 51 records from 91 to 141 all ending with /2017 but
> surprisingly, records ending with /2016 or /2015, etc. also appear in
'%/2017' )
e.g.
WHERE MYFIELD SIMILAR TO 'AHH[0-9]{5}/2017'
AND SUBSTRING(MYFIELD FROM 4 FOR 5) BETWEEN '00091' AND '00141'
I.