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.
WHERE. If you run this query a lot and will have many rows, you should use look into a computed column and a persisted index.