求助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
相关问答:
执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......
如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP
参考:http://hi.baidu.com/toiota ......
现在有一个部门表dept(部门名称,部门号。。)有一个人员表emp(姓名,人员编号,职位,薪资,部门)
emp表中的内容是这样的:
a 1 工程师 3000 软件部
b 2 普通员工 2000 硬件部
c 3 工程师 4000 硬件部
d ......
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会有 ......