oracle 取得某一条记录中的,所有当天记录

取得某一条记录的当天所有记录

1.常见方式
select * from syslog_logstack a where to_date(to_char(createtime, 'yyyy-mm-dd'), 'yyyy-mm-dd') =
(select to_date(to_char(createtime, 'yyyy-mm-dd'), 'yyyy-mm-dd') as createtime  from syslog_logstack t where t.logstack_id='83899')

2.这样更简单
select * from syslog_logstack a where to_char(createtime, 'yyyy-mm-dd') =
(select to_char(createtime, 'yyyy-mm-dd') as createtime  from syslog_logstack t where t.logstack_id='83899')

你可能感兴趣的:(oracle)