查询一天所有的信息:
select *(查询内容) from (表名) where (时间)>设定时间 and (时间)<设定时间
select * from StudentBindPaperTypeEntity where StudentBindPaperTypeEntity.TimeTamp > '2019-01-04 00:00:00' and StudentBindPaperTypeEntity.TimeTamp< '2019-01-05 00:00:00'
多表连接查询:通过连接运算符来实现多张表连接数据查询。
分类:内连接(分为连接分为等值连接、自然连接和自连接三种。 ),外连接(分为左外连接,右外连接,全外连接)
内连接,关键字(inner join)
定义:两个表都满足where条件的数据留下。如下图的满足where条件交集部分。
select (查询内容)
from 表1 as a with(nolock)
inner join 表2 as b with(nolock)
on a.时间字段=b.时间字段(这个地方填两个表内容相同的数据)
where (条件)