need to search row by part of string

  • Thread starter Thread starter yuvalbra
  • Start date Start date
Y

yuvalbra

I need to find the rows that exist in one table but not in the other
with this condition:

(prod_name exist in table1 and not in table2.prod_name )

table1.prod_name build as a sting that include 'S' and string after
it (Like S32A48)
table2.prod_name build as a sting that the string after it (Like
32A48)

sample:
table1.prod_name :
S455AA
S65482N
S9999

table2.prod_name :
13A222
65482N
9999


Output:
S65482N
S9999


B.R
yuvi
 
Your example seems to be at odds with your words. You're saying that you
want to know those rows that exist in one table but not in the other, but
your example shows those rows that exist in both.

If you're comfortable working with SQL, to get those rows that exist in
both, you need something like:

SELECT Table1.prod_name
FROM Table1 INNER JOIN Table2
ON Table1.prod_name = "S" & Table2.prod_name

To get those rows in Table1 that don't exist in Table2, you need something
like:

SELECT Table1.prod_name
FROM Table1 LEFT JOIN Table2
ON Table1.prod_name = "S" & Table2.prod_name
WHERE Table2.prod_name IS NULL

To do this via the graphical query building, first create a query based on
Table2 that has a computed field "S" & [prod_name]. You can then use that
query instead of Table2 in a second query to do what you're trying to do.
 
Back
Top