f********0 发帖数: 73 | 1 I have 2 tables a ( with columns a1(string) and a2) and b (with columns b1(
string) ).
For each record in a, if a1 is contained with any one or more record of b1,
the a2 is updated to 1. How to write a mysql query for this.(like a1="abc",
one b1="4abct", the corresponding a2 in the record is updated to 1).
Thanks for your help. | d*******8 发帖数: 3182 | 2 Maybe it is too simple that nobody would like to answer this question.
Let me try:
update a, b set a.a2 = 1 where INSTR(b.b1, a.a1) > 0 | B*****g 发帖数: 34098 | 3 ding.
这个performance怎么样?
【在 d*******8 的大作中提到】 : Maybe it is too simple that nobody would like to answer this question. : Let me try: : update a, b set a.a2 = 1 where INSTR(b.b1, a.a1) > 0
| c******l 发帖数: 36 | 4 explain update .....
【在 B*****g 的大作中提到】 : ding. : 这个performance怎么样?
|
|