两个表的问题现在解决了。出现三表的问题了。 update a set a.id = ( select c.id from b,c where b.num = a.num and b.num = c.num and c.dept_id = '0601') where a.user_id = '02040001' and a.dept_id = '0601'; 提示我无法将a.id更新为NULL 但执行: select c.id from a,b,c where b.num = a.num and b.num = c.num and c.dept_id = '0601' where a.user_id = '02040001' and a.dept_id = '0601'; 返回值为'03001' 求助啊。苦恼死我了。
update a set a.id=(select c.id from a,b,c where b.num = a.num and and b.num = c.num and a.user_id = '02040001' and a.dept_id = '0601') 沒有測試,你自己看看
update a set a.id=(select c.id from a,b,c where b.num = a.num and and b.num = c.num and a.user_id = '02040001' and a.dept_id = '0601') where a.user_id = '02040001' and a.dept_id = '0601';
update a
set a.id =
(
select c.id
from b,c
where b.num = a.num
and b.num = c.num
and c.dept_id = '0601')
where a.user_id = '02040001'
and a.dept_id = '0601';
提示我无法将a.id更新为NULL
但执行:
select c.id
from a,b,c
where b.num = a.num
and b.num = c.num
and c.dept_id = '0601'
where a.user_id = '02040001'
and a.dept_id = '0601';
返回值为'03001'
求助啊。苦恼死我了。
set a.id=(select c.id from a,b,c where b.num = a.num and and b.num = c.num
and a.user_id = '02040001' and a.dept_id = '0601')
沒有測試,你自己看看
set a.id=(select c.id from a,b,c where b.num = a.num and and b.num = c.num
and a.user_id = '02040001' and a.dept_id = '0601')
where a.user_id = '02040001'
and a.dept_id = '0601';