select to_char(t1.timestamp,'hh24:mi') timestamp, t1.value, t1.key_num
from pmis.hb_ems_fh t1,pmis.puer_ems_registab t2
where to_char(timestamp,'yyyy-mm-dd')='2004-05-01'
and t1.key_num=t2.key_num and t2.SFXS='1'
order by t1.timestamp, t2.xh
from pmis.hb_ems_fh t1,pmis.puer_ems_registab t2
where to_char(timestamp,'yyyy-mm-dd')='2004-05-01'
and t1.key_num=t2.key_num and t2.SFXS='1'
order by t1.timestamp, t2.xh
select to_Char(T1.timestamp,'hh24:mi') timestamp,
t1.value,
t1.key_num
from pmis.hb_ems_fh t1 left join pmis.puer_ems_registab t2 on t1.key_num=t2.key_num and t2.sfxs='1'
where to_char(timestamp,'yyyy-mm-dd')='2004-05-01'
order by t1.timestamp,t2.xh
我在PLSQL里面使用很方便的。
我发现这个条件没有起作用啊!
打上括号也没用!
请问怎么回事?
from pmis.hb_ems_fh t1,pmis.puer_ems_registab t2
where timestamp>to_date('2004-05-01' ,'yyyy-mm-dd') and
timestamp<to_date('2004-05-01' ,'yyyy-mm-dd')+1 and
and t1.key_num=t2.key_num and t2.SFXS='1'
order by t1.timestamp, t2.xh如果还慢那就只有把timestamp加为索引了。记住:to_date要比to_char快
S.F.(CSDN:896410000) 的程序也比我从前的代码快了30%左右,特此感谢!