当前位置: 代码迷 >> Oracle管理 >> 求教这句sql什么意思。该怎么解决
  详细解决方案

求教这句sql什么意思。该怎么解决

热度:42   发布时间:2016-04-24 04:34:12.0
求教这句sql什么意思。。。


select distinct 
       a.os_username os_user,
       a.userhost,
       a.username db_user,
       to_char(a.timestamp,'yyyy-mm') Year_Month,
       a.action_name action_name       
from   dba_audit_trail a
where  a.timestamp >= to_date(to_char(sysdate,'yyyymm')-1||'16','yyyymmdd') 
and    a.timestamp < to_date(to_char(sysdate,'yyyymm')||'01','yyyymmdd')
and          a.action in (100)
order by a.action_name

select distinct 
       a.os_username os_user,
       a.userhost,
       a.username db_user,
       to_char(a.timestamp,'yyyy-mm') Year_Month,
       a.action_name action_name       
from   dba_audit_trail a
where  a.timestamp >= to_date(to_char(sysdate,'yyyymm')||'01','yyyymmdd') 
and    a.timestamp < to_date(to_char(sysdate,'yyyymm')||'16','yyyymmdd')
and          a.action in (100)
order by a.action_name

求教这几句话是什么意思???

------解决方案--------------------
timestamp >= 本月一号
timestamp <  本月十六号
------解决方案--------------------
引用:
Quote: 引用:

这不就是普通的sql吗。。。。
有啥特殊,难懂的地方?

where  a.timestamp >= to_date(to_char(sysdate,'yyyymm')
------解决方案--------------------
'01','yyyymmdd') 
and    a.timestamp < to_date(to_char(sysdate,'yyyymm')
------解决方案--------------------
  相关解决方案