本文介绍了如何在嵌套查询中插入左连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
首先感谢帮助过这个复杂难查询的朋友们.
First of all I would like to thank the friends who helped this complex and difficult query.
我有三张桌子
表一
表 2
表 3
我想要学生每天的第一个和最后一个动作.如果在指定日期之间没有可用的移动,则必须将值设置为 null
I want the first and last movements of students for each day. Value must be set to null if no movement is available between the specified dates
输出:
以下查询部分有效.
这里是 SQL Fiddle.
Here is a SQL Fiddle.
如何将 firstGateName 和 LastGateName 添加到此查询结果中?
推荐答案
您只需将现有查询加入Gates
表即可获取这些名称,即
You can just join your existing query to the Gates
table to get those names, i.e.
在您的情况下,您可以使用您拥有的总价值加入
In your case you can join using the aggregate value you've
这篇关于如何在嵌套查询中插入左连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!