以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助] 数据库表带出相关内容 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=152692) |
||||
-- 作者:susanhe -- 发布时间:2020/7/18 20:27:00 -- [求助] 数据库表带出相关内容 你好,老师, SQL后台数据库中有表test 和test1, 如何在窗口中的按钮中快速实现 : 将test1表中FItemID的从表test中根根相同的FInterId将其快速取过来 ? 附上实例,感谢。
|
||||
-- 作者:susanhe -- 发布时间:2020/7/18 20:27:00 -- 这是实例 . [此贴子已经被作者于2020/7/19 18:56:07编辑过]
|
||||
-- 作者:susanhe -- 发布时间:2020/7/18 20:28:00 --
|
||||
-- 作者:susanhe -- 发布时间:2020/7/19 18:57:00 -- 请指点。 |
||||
-- 作者:有点蓝 -- 发布时间:2020/7/19 21:54:00 -- 如果是access,内部表 update {test1} a,{test} b set a.FItemID=b.FItemID where a.FInterID = b.FInterID 如果是SqlServer update test1 set FItemID=a.FItemID from test As a where a.FInterID = test1.FInterID
|
||||
-- 作者:susanhe -- 发布时间:2020/7/20 7:36:00 -- 谢谢老师, 我是的SqlServer 因为数据有上几十万条,每次都要全部再更新一次,太慢了,有没有可能只对其中发生变化的进行更新,这样效率就高了,谢谢 。
|
||||
-- 作者:有点蓝 -- 发布时间:2020/7/20 8:49:00 -- update test1 set FItemID=a.FItemID from test As a where a.FInterID = test1.FInterID and a.FItemID<> test1.FItemID 最好是加上其他条件,比如日期,只处理本年、月..的数据
|
||||
-- 作者:susanhe -- 发布时间:2020/7/20 15:47:00 -- 老师,如图,请指点一下。 |
||||
-- 作者:susanhe -- 发布时间:2020/7/20 15:48:00 -- ![]() ![]() |
||||
-- 作者:有点蓝 -- 发布时间:2020/7/20 15:57:00 -- 执行sql在这里:http://www.foxtable.com/webhelp/topics/1484.htm, 不是在命令窗口,在目录窗口需要使用SQLcommand:http://www.foxtable.com/webhelp/topics/0696.htm
|