oracle sql语句报错????

[复制链接]
查看11 | 回复3 | 2012-8-15 11:34:49 | 显示全部楼层 |阅读模式
你的t.taxid=t1.taxid 在你这tradedetail,up_areacode两张表中都不是primary key,也不是外键,当orcl在执行你这语句的时候先是找到你这两张表的表关系如果你要继续执行下去的话,建议你在建表语句中加入set taxid primary key和set taxid primary key语句...
回复

使用道具 举报

千问 | 2012-8-15 11:34:49 | 显示全部楼层
这样的更新必须是tradedetail 和up_areacode中 taxid都是主键的情况下,t.taxid o ,t1.taxid oo ,t.taxname a ,t1.taxname aa 不需要查询出来.如果不是,只能用一般的更新update ... setwhere exists ......
回复

使用道具 举报

千问 | 2012-8-15 11:34:49 | 显示全部楼层
updatetradedetail t set t.finareacode =(select finareacode from tradedetail t1 where t.taxid=t1.taxid ) where t.finareacode is not null...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行