首页 > 数据库技术 > 详细

两个相似SQL的查询结果,以前未曾注意

时间:2017-06-23 09:56:41      阅读:329      评论:0      收藏:0      [点我收藏+]

两个相似SQL的查询结果,以前未曾注意



select a.*, case when x.resno is null then 0 else 1 end as isown from prm_res a

left join 

(select b.resno from prm_res b

inner join prmg_role_res c on b.resno=c.resno

inner join prmg_acct_role d on d.roleno=c.roleno and d.acct=1

) as x

on a.resno=x.resno where a.sysno=1;

技术分享


select a.*, case when x.resno is null then 0 else 1 end as isown from prm_res a

left join 

(select b.resno from prm_res b

inner join prmg_role_res c on b.resno=c.resno

inner join prmg_acct_role d on d.roleno=c.roleno and d.acct=1

) as x

on a.resno=x.resno and a.sysno=1;

技术分享


谁知道啥情况?欢迎留言

本文出自 “熔 岩” 博客,请务必保留此出处http://lavasoft.blog.51cto.com/62575/1941135

两个相似SQL的查询结果,以前未曾注意

原文:http://lavasoft.blog.51cto.com/62575/1941135

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!