易截截图软件、单文件、免安装、纯绿色、仅160KB

求助sql server语句 - MS-SQL Server / 应用实例

SELECT s.StationID, s.StationName, A.FileBeginTime, A.FileEndTime
from Station s INNER JOIN
  Camera c ON s.StationID = c.StationID INNER JOIN
  ArchiveFile A ON A.CameraSign = c.CameraSign
WHERE (s.StationName = '二楼EMBA')
ORDER BY s.StationID, A.FileBeginTime, A.FileEndTime

我在三张表中用语句查询出了这样一个结果:
StationID StationName FileBeginTime FileEndTime
2 二楼EMBA 2010-3-18 15:51:12 2010-3-18:15:35:26
2 二楼EMBA 2010-3-18 15:54:42 2010-3-18 16:00:00
2 二楼EMBA 2010-4-1 09:27:07 2010-4-1 12:30:00
2 二楼EMBA 2010-4-1 09:27:07 2010-4-1 12:30:00
2 二楼EMBA 2010-4-1 09:27:07 2010-4-1 12:30:00
2 二楼EMBA 2010-4-1 13:00:04 2010-4-1 18:00:04
2 二楼EMBA 2010-4-1 13:00:04 2010-4-1 18:00:05
2 二楼EMBA 2010-4-1 13:00:01 2010-4-1 18:00:54
2 二楼EMBA 2010-4-1 18:00:04 2010-4-1 18:15:00
2 二楼EMBA 2010-4-1 18:00:04 2010-4-1 18:15:00
2 二楼EMBA 2010-4-1 18:00:04 2010-4-1 18:15:01
…………………………
我想得到这样的结果:
Station StationName FileBeginTime FileEndTime(允许时间上有一分钟的误差)
2 二楼EMBA 2010-4-1 09:27:07 2010-4-1 12:30:00
2 二楼EMBA 2010-4-1 13:00:04 2010-4-1 18:00:04
2 二楼EMBA 2010-4-1 18:00:04 2


相关问答:

csv文件转换成sql导入到数据库,没有数据为何?

执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......

MS SQL作业问题 - MS-SQL Server / 应用实例

如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP

参考:http://hi.baidu.com/toiota ......

sql语句问题 - MS-SQL Server / 疑难问题

现在有一个部门表dept(部门名称,部门号。。)有一个人员表emp(姓名,人员编号,职位,薪资,部门)
emp表中的内容是这样的:
a 1 工程师 3000 软件部
b 2 普通员工 2000 硬件部
c 3 工程师 4000 硬件部
d ......

sql语句问题 - Java / Web 开发

select o_customer,o_price from orders having o_price >=avg(o_price)
select o_customer,o_price from orders where o_price >=(select avg(o_price) from orders)
我感觉没有区别啊,怎么在mysql会有 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号