Answer the question
In order to leave comments, you need to log in
How to find a match in a table?
There are two tables.
Table 1.
999991 Petro Petrovich Petreno
3323123 Vasily Vasilyevich Vasiliev
32321312 Evgeniy Evgenievich Evgenev
(this is one column)
Table 2.
Petro Petrovich Petr
Vasily Vasilyev Evgeniy
Evgeni
It is necessary to find matches for these parts in the tables. But in table 1, not all entries from the second. How to make a selection, and it would be ideal to just update the second one. Ie Petro Petrovich Peter => 999991 Petro Petrovich Petreno. I hope I wrote clearly
Answer the question
In order to leave comments, you need to log in
If you want to get records only those that are in both the first and second table, then use INNER JOIN.
Example
SELECT
T2.Name,
T1.Name
FROM Table2 AS T2
INNER JOIN Table1 AS T1
ON T2.Name LIKE T1.Name
UPDATE Table2 SET Table2.Name = T1.Name
FROM Table2 AS T2, Table1 AS T1
WHERE T2.Name Like T1.Name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question