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

谢谢分享啊。
页: [1]
查看完整版本: DB2怎么取所选的那天的记录