Informix datetime:如何减去15分钟

时间:2017-03-13 15:23:12

标签: datetime intervals informix

如何在IBM Informix中执行此MySQL语句?

select type, channel, teilnr, starttime, endtime, usedtime, host 
from online_time 
where starttime < DATE_SUB(NOW(),INTERVAL 15 MINUTE)
order by starttime desc 

我在Informix中尝试了这个,但它给出了语法错误。

select type, channel, teilnr, starttime, endtime, usedtime, host 
from online_time 
where starttime < subdate(CURRENT, INTERVAL "15" MINUTES)
order by starttime desc 

1 个答案:

答案 0 :(得分:7)

public abstract class MyCollection<E> extends AbstractCollection<E> {

@Override
public String toString() {
    Iterator<E> it = iterator();
    if (! it.hasNext())
        return "()";

    StringBuilder sb = new StringBuilder();
    sb.append('(');
    for (;;) {
        E e = it.next();
        sb.append(e == this ? "(this Collection)" : e);
        if (! it.hasNext())
            return sb.append(')').toString();
        sb.append(' ');
    }
}