sql server 2000语句求肋 - MS-SQL Server / 应用实例
我这有二张表,
表一:ArvichFile
CameraSign(int 4),FileEndTime(datetime),FileEndTime(datetime)
303101 2010-3-18 15:51:12 2010-3-18:15:35:26
303201 2010-3-18 15:54:42 2010-3-18 16:00:00
303101 2010-4-1 09:20:07 2010-4-1 12:30:00
303201 2010-4-1 09:20:07 2010-4-1 12:30:40
303501 2010-4-1 09:20:07 2010-4-1 12:30:00
204101 2010-4-1 09:27:07 2010-4-1 12:30:00
204201 2010-4-1 09:27:07 2010-4-1 12:30:00
204301 2010-4-1 09:27:07 2010-4-1 12:30:00
204101 2010-4-22 09:27:07 2010-4-22 12:30:00
204201 2010-4-22 09:27:47 2010-4-22 12:30:00
204301 2010-4-22 09:27:07 2010-4-22 11:30:00
304101 2010-4-1 13:00:04 2010-4-1 18:00:04
304201 2010-4-1 13:00:04 2010-4-1 18:00:05
304301 2010-4-1 13:00:01 2010-4-1 18:00:54
305101 2010-4-1 18:00:04 2010-4-1 18:15:00
305201 2010-4-1 18:00:04 2010-4-1 18:15:00
305301 2010-4-1 18:00:04 2010-4-1 18:15:01
表二:Camera
StationID(int 4) CameraSign(int 4)
1 303101
1 303201
1 303501
2 204101
2 204201
2 204301
3 304101
3 304201
3 304301
4 305101
4 305201
4 305301
现在已知的是StationID
要得出的结果是:
StationID FileBeginTime FileEndTime
1 2010-4-1 09:20:07 2010-4-1 12:30:00
2 2010-4-1 09:27:07 2010-4-1 12:30:00
3 2010-4-1 13:00:04 2010-4-1 18:00:04
4 2
相关问答:
tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......
现在有一个部门表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会有 ......
在Access的查询中执行下面的语句,无效,提示期待select ,updata ,...
CreateTble C=Answer N="回帖表"
(
C=ID T="INTEGER" P=No M=No N="编号" Z=false,
C=Ques ......
执行数据库操作时,直接用SQL 语句好一些 还是用存储过程更佳呢?
各抒起见
这个的具体问题具体分析
简单的select 、update和insert当然sql解决了
复杂的放在sql服务端应该好点
楼主请参阅
http://msdn.micr ......