欢迎光临
我们一直在努力

out joint query(原创)-数据库专栏,SQL Server

建站超值云服务器,限时71元/月

这个是相对于一般的inner joint query 来说的另外一种联合查询;
关键字:(+) 
e.g where a.cardid = b.cardid(+) ,其中 “ (+)“写在信息不足的一方;

比如tablecard表中有所有的卡的记录,而tableentitle中存在有授权的卡的授权记录;
这样用一般的inner joint query :where a.cardid = b.cardid 这是不会显示出没有授权的卡的信息
而如果用out joint query: where a.cardid = b.cardid(+)
select  a.cardid, a.cardseires, b.productid,b.expiredate from  tablecard  a, tableentite b where a.cardid=b.cardid(+) order by cardid;

这样可以显示出所以的卡记录,无论这张卡有没有授权记录; 

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » out joint query(原创)-数据库专栏,SQL Server
分享到: 更多 (0)

相关推荐

  • 暂无文章