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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
I
InfoQ
博客园_首页
G
Google Developers Blog
爱范儿
爱范儿
Last Week in AI
Last Week in AI
量子位
阮一峰的网络日志
阮一峰的网络日志
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
月光博客
月光博客
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东

博客园 - 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