惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
美团技术团队
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
A
About on SuperTechFans
Recent Announcements
Recent Announcements
D
Docker
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
腾讯CDC
Martin Fowler
Martin Fowler
阮一峰的网络日志
阮一峰的网络日志

博客园 - riky

右键cmdshell DBLINK使用实战 vnc.conf 1521 error1 - riky - 博客园 多项目同步进行“交叉编译” HIBERNATE 多表查询的解决方案 - riky - 博客园 动态添加SWAP分区 中文正则式 - riky - 博客园 消息处理2 消息处理1 vs2008 程序 xp风格 - riky REWRITE DEBUG... - riky - 博客园 ssi conf. SSI2 SSI 大型-WEBSITE建设资料2 大型WEB-SITE建设资料 cygwin中 unable get setup.ini from... 的错误问题 NetPerf 计划
oracle 日期相关的东东和几个应用的例子 - riky - 博客园
riky · 2009-11-23 · via 博客园 - riky

获取本月第一天和最后一天

select to_char(trunc(add_months(last_day(sysdate), -1) + 1), 'yyyy-mm-dd') "本月第一天",
       to_char(last_day(sysdate), 'yyyy-mm-dd') "本月最后一天"
from dual

一个综合运用IN 筛选的 例子

select t.firm_id, t.customer_id, t.commodity_id, t.bs_flag, t.qty from ce.trd_oitrades t
   where t.customer_id in (select c.customer_id from  ce.bas_customerinfo c where c.type='N') and
         t.commodity_id in (select f.commodity_id from ce.bas_f_commodityinfo f where trunc(add_months(last_day(sysdate), -1) + 1)<f.l_tra_date and f.l_tra_date<last_day(sysdate)) ;

去除customerid列重复,并合并 HOLD_VOL列

select distinct t.customerid, sum(t.hold_vol) from es_bo_hold_indelmon t
group by t.customerid
order by t.customerid