数据库查询语句

1、级联查询用户权限,查询类型为4的用户数据中心权限
select t.*, t.rowid from xt_userresc t where t.userid in (select t.id from tbbcuser t where usertype = 4) order by userid

 


2、删除在TBBCUSER中不存在用户对应的数据中心权限

select t.*, t.rowid from xt_userresc t where t.userid not in (select t.id from tbbcuser t ) order by userid

你可能感兴趣的:(数据库,查询,权限)