这样的查询语句怎么写? 我想这样行不行,先从表内取得一个最小的时间,然后用它+3小时,然后用select把>=最小时间和<=+3小时后的时间的这段内容取出来放一个新表。用while循环做,直到affectedrow=0为止。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select CurrAll, CurrTime from table Awhere currtime in (select top 1 currtime from table where currtime > datediff(hour,3,A.currtime)order by currtime) 我本来想帮楼主做一下,就建了个表create table A(currall float,currtime datetime)然后把楼主的表贴到d:\aaaa.txt里,然后执行bulk insert Afrom 'd:\aaaa.txt'with(fieldterminator=' ',rowterminator='\n')结果发现select * from A结果却是:158.63' 2004-06-08 09:42:00.000158.68000000000001' 2004-06-08 09:44:00.000159.22' 2004-06-08 10:07:00.000159.27000000000001' 2004-06-08 10:09:00.000159.31999999999999' 2004-06-08 10:11:00.000159.96000000000001' 2004-06-08 10:38:00.000160.00999999999999' 2004-06-08 10:40:00.000160.06' 2004-06-08 10:42:00.000160.11000000000001' 2004-06-08 10:44:00.000160.16' 2004-06-08 10:46:00.000160.84' 2004-06-08 11:10:00.000160.91' 2004-06-08 11:12:00.000160.97999999999999' 2004-06-08 11:14:00.000161.05000000000001' 2004-06-08 11:17:00.000161.12' 2004-06-08 11:19:00.000我原样导入的数据怎么有的是2位小数有的却变了呢?请知情者点拨 默认参照完整性的简单问题 一个SQL查询的菜鸟问题~请指教啊~~~ 在SQL中向多个数据库中插入相同的记录? 有何办法把把"aa.bcp"(SYSBASE中BCP得到的)文件导入SQL 2000 select 简单查询, 5分钟以上 用dts 同步,,dts包问题,麻烦帮忙!! ((o)(o))请各位搞数据库的朋友来帮帮忙3Q !!! 关于字段类型!!! sql help document! 如何用SQL的函数求得当前程序的进程号(SPID)值? 就10分了。问一下在update里 - 怎么引 菜鸟发问:如何用参数传递表名???
where currtime in (
select top 1 currtime from table
where currtime > datediff(hour,3,A.currtime)
order by currtime
)
create table A
(currall float,currtime datetime)
然后把楼主的表贴到d:\aaaa.txt里,
然后执行
bulk insert A
from 'd:\aaaa.txt'
with(fieldterminator=' ',rowterminator='\n')
结果发现select * from A结果却是:
158.63' 2004-06-08 09:42:00.000
158.68000000000001' 2004-06-08 09:44:00.000
159.22' 2004-06-08 10:07:00.000
159.27000000000001' 2004-06-08 10:09:00.000
159.31999999999999' 2004-06-08 10:11:00.000
159.96000000000001' 2004-06-08 10:38:00.000
160.00999999999999' 2004-06-08 10:40:00.000
160.06' 2004-06-08 10:42:00.000
160.11000000000001' 2004-06-08 10:44:00.000
160.16' 2004-06-08 10:46:00.000
160.84' 2004-06-08 11:10:00.000
160.91' 2004-06-08 11:12:00.000
160.97999999999999' 2004-06-08 11:14:00.000
161.05000000000001' 2004-06-08 11:17:00.000
161.12' 2004-06-08 11:19:00.000
我原样导入的数据怎么有的是2位小数有的却变了呢?
请知情者点拨