在tbl_usre_role里面有这么一条记录:
select
FROM tbl_user_role ur
left join tbl_user u
on ur.user_id = u.user_id
WHERE ur.role_id = '1'
and u.account_type != '1';
我想把这条记录删掉,这样写可以吗?
delete
FROM tbl_user_role ur
left join tbl_user u
on ur.user_id = u.user_id
WHERE ur.role_id = '1'
and u.account_type != '1';
select
FROM tbl_user_role ur
left join tbl_user u
on ur.user_id = u.user_id
WHERE ur.role_id = '1'
and u.account_type != '1';
我想把这条记录删掉,这样写可以吗?
delete
FROM tbl_user_role ur
left join tbl_user u
on ur.user_id = u.user_id
WHERE ur.role_id = '1'
and u.account_type != '1';
解决方案 »
- oracle 触发器 提示未说明结合变量"OLD"
- D:\oracle\oradata\Ora\temp01.dbf在控制台最大能改到32G 请问还要再改大如何操作
- 这样的存储过程怎么处理啊?
- 求教几个小问题。。。。
- 表空间压缩问题!
- 我想把我用pb和oracle做的程序一起发布,不用安装oracle客户端,怎么办?
- 怎样在Oracle中取出时间差?
- proc 查询多字段记录问题?
- 千万火急求救,高分赠送,怎样备份oracle数据库所有对象(包括表,存储过程,函数,触发器…)
- 错误: PL/SQL: Compilation unit analysis terminated
- 这样的SQL怎么写??
- 如何查询出上个月的所有数据
where ur.role_id = '1'
and not exists(select * from tbl_user u where ur.user_id = u.user_id
and u.account_type = '1');
FROM tbl_user_role ur
left join tbl_user u
on ur.user_id = u.user_id
WHERE ur.role_id = '1'
and u.account_type != '1';
这样不行?
FROM tbl_user_role ur
where ur.role_id='1'
and ur.user_id in (select user_id from tbl_user where accout_type !='1')
delete FROM tbl_user_role ur
where exists(select 1 from
tbl_user u where ur.user_id = u.user_id and u.account_type != '1')
and ur.role_id = '1'