有表
creat table T1(
id integer,
time VARCHAR2(20) DEFAULT TO_CHAR(SYSDATE,'YYYYMMDDHH24MISS') --以字符串形式存放时间
)现在我想查找该表中大于当前时间的id号,用了下面的语句结果出错了
select id
from T1
where to_date(time) > sysdate;请问我想实现上面的功能,应该怎么写这条SQL语句呢?请帮帮忙!
creat table T1(
id integer,
time VARCHAR2(20) DEFAULT TO_CHAR(SYSDATE,'YYYYMMDDHH24MISS') --以字符串形式存放时间
)现在我想查找该表中大于当前时间的id号,用了下面的语句结果出错了
select id
from T1
where to_date(time) > sysdate;请问我想实现上面的功能,应该怎么写这条SQL语句呢?请帮帮忙!
---------- --------------------
1 23-9月 -05
6 26-9月 -05
4 21-9月 -05
2 20-9月 -05SQL> select id from t1 where time > to_char(sysdate); ID
----------
6SQL>