how to find values exactly the same, but only one char differs?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

I have a product list.

Their names are like,

XYQ A2AJCJ AB

I must find products that are same, but only the for example 21st character
of the product name are different.

I mean like;

XYQ A2AJCJ AB
XYQ A2AJCJ BB

I must find all product names that are in that situation.

You can give the solution for product names in same column or in same table,
different columns or in different tables.

Waiting for your reply,

Kind regards..
 
Is it always the 21st character or are you saying it could be any one of the
characters would be different?
 
Dear Duck:

You can use a relationship in which all but the 21st character is identical.

WHERE Left(T.KeyColumn, 20) = Left(T1.KeyColumn, 20)
AND Right(T.KeyColumn, 1) = Right(T.Keycolumn, 1)

This works for only the 21st character condition you told us. What other
conditions do you have?

I can write a query that shows two columns with your "product name" values
from two rows, but this ignores the possibility that there may be more than
two matching "product name" values in a set, such as:

XYQ A2AJCJ AB
XYQ A2AJCJ BB
XYQ A2AJCJ CB

Please explain what all the rules are for "products that are the same" to
get a thorough explanation of what is needed.

Tom Ellison
 
Back
Top