Home
Sign Up
Sign In
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member
Sign In
V2EX
›
问与答
弱弱的问一个mysql语句怎么写...我试了两次都不work...
mongodb
·
Nov 20, 2013
· 3299 views
This topic created in 4548 days ago, the information mentioned may be changed or developed.
a表和b表
都有tid和subject字段
tid一一对应。
b表中subject字段只有部分行存在内容,其余为空。
现在需求为:
根据a表的tid找到b表的对应tid,查找此行的subject字段,若不为空,则将此字段内容用来替换掉a表里对应的subject字段。
我现在边翻手册边写,还是迷迷糊糊的...
tid
subject
字段
1 replies
•
1970-01-01 08:00:00 +08:00
1
icanc
Nov 20, 2013
update a,b set a.subject= b.subject where a.tid=b.tid and b.subject is not null;
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
2533 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 29ms ·
UTC 10:57
·
PVG 18:57
·
LAX 03:57
·
JFK 06:57
♥ Do have faith in what you're doing.
❯