Chinaunix
标题:
DB2怎么取所选的那天的记录
[打印本页]
作者:
AlexMoonshadow
时间:
2011-12-02 10:54
标题:
DB2怎么取所选的那天的记录
select * from tb_dp_task where char(create_date) < char('2011-12-01 23.59.59');
select * from tb_dp_task where date(create_date) < date('2011-12-01');
我用这个查不到2011-12-01那天的数据
要怎么写能取到?
作者:
AlexMoonshadow
时间:
2011-12-02 11:20
create_date的类型是TIMESTAMP
作者:
shenzhenzsf
时间:
2011-12-03 11:33
select * from tb_dp_task where date(create_date) = date('2011-12-01');
作者:
sychangchun
时间:
2012-01-26 19:27
谢谢分享啊。
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2