declare
startdate date;
enddate date;
begin
startdate := to_date('2011-09-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss');
enddate := to_date('2011-09-15 00:00:00', 'yyyy-mm-dd hh24:mi:ss');
select t.RECEIVETIME, t.speedometer --83315 412.046s
from bmps_his_receive_gpsinfo t
where t.speedometer > 0 --83315 261.187s
and t.locatestate != 0 --83173 251.438s
and t.MCUID = 1000000969
and t.RECEIVETIME between startdate and enddate;
end;一条这么简单的SQL都无法通过,无非就是声明两个变量给SQL语句用!!!!还提示select缺少 into错误,MD 在SQL Server怎么可以这样做!!!!查了很多资料 都不行
startdate date;
enddate date;
begin
startdate := to_date('2011-09-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss');
enddate := to_date('2011-09-15 00:00:00', 'yyyy-mm-dd hh24:mi:ss');
select t.RECEIVETIME, t.speedometer --83315 412.046s
from bmps_his_receive_gpsinfo t
where t.speedometer > 0 --83315 261.187s
and t.locatestate != 0 --83173 251.438s
and t.MCUID = 1000000969
and t.RECEIVETIME between startdate and enddate;
end;一条这么简单的SQL都无法通过,无非就是声明两个变量给SQL语句用!!!!还提示select缺少 into错误,MD 在SQL Server怎么可以这样做!!!!查了很多资料 都不行
select t.RECEIVETIME, t.speedometer --83315 412.046s
from bmps_his_receive_gpsinfo t
where t.speedometer > 0 --83315 261.187s
and t.locatestate != 0 --83173 251.438s
and t.MCUID = 1000000969
and t.RECEIVETIME between to_date('2011-09-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and to_date('2011-09-15 00:00:00', 'yyyy-mm-dd hh24:mi:ss');
在declare里面必须into