首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

简略sql,送分交友型

2011-12-10 
简单sql,送分交友型表A:studentId表B:studentId1,studentId2要求A.studentIdB.studentId1时,将相应的B.st

简单sql,送分交友型
表A:
studentId

表B:
studentId1,studentId2

要求A.studentId=B.studentId1时,   将   相应的B.studentId2的值设给A.studentId

实现这个功能的比较好的sql代码

[解决办法]
写了一个,应该是用exists的常规写法吧?
update A T1 set studentId=(select studentId2 from B where t1.studentId=studentId1)
where exists(select 1 from studentId2 where t1.studentId=studentId1)

[解决办法]
字段写错了
update A T1 set studentId=(select studentId2 from B where t1.studentId=studentId1)
where exists(select 1 from B where t1.studentId=studentId1)
[解决办法]
update A set A.studentId = (select B.studentId2 from B where B.studentId1 = A.studentId);
[解决办法]
各位好,Oracle目前不可以下載Deveploper,誰有現成的Oracle9ii開發軟件Developer,
QQ: 183098289
在線等
謝謝!

热点排行