当前位置:网站首页>oracle的sql改成mysql版本
oracle的sql改成mysql版本
2022-08-02 08:01:00 【CSDN问答】
oracle语句改写成mysql
select nvl(sum(is_this_month),0) as total, nvl((sum(is_this_month) - sum(is_last_month)),0) as month_count, nvl((sum(is_today) - sum(is_last_day)),0) as day_count from (select case when to_char(TRUNC(SYSDATE - 1), 'dd') = to_char(VALID_DATE, 'dd') then 1 else 0 end as is_last_day, case when to_char(sysdate, 'dd') = to_char(VALID_DATE, 'dd') then 1 else 0 end as is_today, case when to_char(sysdate, 'MM') = to_char(VALID_DATE, 'MM') then 1 else 0 end as is_this_month, case when to_char(TRUNC(add_months(trunc(sysdate), -1), 'MM'), 'MM') = to_char(VALID_DATE, 'MM') then 1 else 0 end as is_last_month from (SELECT * FROM API_SERVICE WHERE VALID_DATE is not null and VALID_DATE > TRUNC(ADD_MONTHS(sysdate, -1), 'mm'))) b
如何改写成mysql版本
边栏推荐
- 构建Flink第一个应用程序
- MySQL之创建表的基本操作
- CASA模型、CENTURY模型应用与案例分析
- Biotin hydrazide HCl|CAS:66640-86-6|生物素-酰肼盐酸盐
- EPSANet: An Efficient Pyramid Split Attention Block on Convolutional Neural Network
- Technology Cloud Report: To realize the metaverse, NVIDIA starts from building an infrastructure platform
- 18、优化网站性能
- 五款优秀免费的在线抠图工具
- Wang Xuegang - compiled shipment line file
- Postgres horizontal table, automatically create partitions, table by time
猜你喜欢
随机推荐
prometheus monitoring mysql_galera cluster
自定义table表格
解决IDEA安装安装插件慢问题
理论问题与工程问题的差异在哪里?
【开源项目】X-TRACK源码分析
(Note)阿克西斯ACASIS DT-3608双盘位硬盘阵列盒RAID设置
MFC最详细入门教程[转载]
R language plotly visualization: plotly visualizes the scatter plot of the actual value of the regression model and the predicted value of the regression, analyzes the prediction performance of the re
HCIP 第五天
Database Plus 的云上之旅:SphereEx 正式开源 ShardingSphere on Cloud 解决方案
@PostConstruct注解详解
Biotin-C6-amine|N-生物素基-1,6-己二胺|CAS:65953-56-2
Biotin-EDA|CAS:111790-37-5| Ethylenediamine biotin
I.MX6U-ALPHA开发板(EPIT定时器实验)
MySQL事务隔离级别详解
nodejs 简介
[OC学习笔记]weak的实现原理
A young man with strong blood and energy actually became a housekeeper. How did he successfully turn around and change careers?
静态路由综合实验
设置 height: auto 却无法触发 transition 动画的解决方案