标题:进出门系统的数据库问题
只看楼主
ahao214
Rank: 1
等 级:新手上路
帖 子:18
专家分:3
注 册:2010-11-20
结帖率:0
 问题点数:0 回复次数:0 
进出门系统的数据库问题
  create table OriginalData
(  PerNo int identity(1,1) primary key,  
PerID nvarchar(20),  Status int,  
CheckTime   datetime  )  
INSERT INTO OriginalData
SELECT 's001',1,'2007-06-11 08:01' UNION ALL
SELECT 's001',1,'2007-06-11 09:02' UNION ALL
SELECT 's001',0,'2007-06-11 10:05' UNION ALL
SELECT 's001',0,'2007-06-11 11:40' UNION ALL
SELECT 's001',1,'2007-06-11 12:00' UNION ALL
SELECT 's001',0,'2007-06-11 12:42' UNION ALL
SELECT 's001',1,'2007-06-11 13:58' UNION ALL
SELECT 's001',0,'2007-06-11 14:50' UNION ALL
SELECT 's001',0,'2007-06-11 15:00' UNION ALL
SELECT 's001',1,'2007-06-11 16:00' UNION ALL
SELECT 's001',1,'2007-06-11 16:30' UNION ALL
SELECT 's001',0,'2007-06-11 17:50' UNION ALL
SELECT 's001',0,'2007-06-11 18:00'   
当有相邻的1或0时,查询出时间小的那个。查询出的结果是1,0,1,0,1....
搜索更多相关主题的帖子: 数据库 
2011-05-11 10:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-339470-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.152568 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved