由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - mysql query question
相关主题
请教怎么来log duration of a MYSQL procedure?HELP: 如何实现 一个简单的Query
a simple question about inserta sql question
Debugging in SQLPLUS, need helphow to do this sql query
MSQuerysql 请教
One sql question help!How to write this query in Oracle?
ask for help with a simple query!!!Help on Oracle Query
How to add a blank column in a Query?请教oracle sql query question
query: in sql server 2005求教如何针对这种情况进行优化
相关话题的讨论汇总
话题: a1话题: a2话题: b1话题: record话题: query
进入Database版参与讨论
1 (共1页)
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怎么样?

1 (共1页)
进入Database版参与讨论
相关主题
求教如何针对这种情况进行优化One sql question help!
这个 Oracle SQL 语句该这么写啊?ask for help with a simple query!!!
怎么reference temp table的columnHow to add a blank column in a Query?
问个sp_send_dbmail 下html format的问题query: in sql server 2005
请教怎么来log duration of a MYSQL procedure?HELP: 如何实现 一个简单的Query
a simple question about inserta sql question
Debugging in SQLPLUS, need helphow to do this sql query
MSQuerysql 请教
相关话题的讨论汇总
话题: a1话题: a2话题: b1话题: record话题: query