Lets say I have a field. Lets call it Barcode1. Right now all Barcodes1 are 22 characters with each character is an integer.
Suppose there is a second field Barcode2. Both of these are varchar(22)
My condition in plain english terms is:
Barcode1 is identical to barcode2 except in digits 7,8 where for barcode2, digits 7 and 8 are the same thing in barcode1 plus 20
so
001214**54**54545654521523
549462**74**48634842135782
I also would like the negation of the where clause where rows that do NOT match the condition are returned.
Thank you.
You’ll have to break that barcode up using string operations, something like:
And since you’ll be doing these comparisons on function results, indexes aren’t going to be used. If this is a frequent operation, you’d be better off splitting up the barcode strings into individual fields so you can compare the individual chunks as fully separate indexable fields.