当前位置:网站首页>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版本
边栏推荐
猜你喜欢

redis的安装与应用

MGRE综合实验

研发过程中的文档管理与工具
![[OC学习笔记]Block三种类型](/img/40/edf59e6e68891ea7c9ab0481fe7bfc.png)
[OC学习笔记]Block三种类型

CASA模型、CENTURY模型应用与案例分析

商业智能平台BI 商业智能分析平台 如何选择合适的商业智能平台BI

Wang Xuegang - compiled shipment line file

Visual Analysis of DeadLock

A young man with strong blood and energy actually became a housekeeper. How did he successfully turn around and change careers?

HCIP 第五天
随机推荐
I.MX6U-ALPHA开发板(定时器按键消抖)
cas: 139504-50-0 Maytansine DM1|Mertansine|
解决IDEA安装安装插件慢问题
十大免费cms建站系统介绍推荐
Flink 系统性学习笔记系列
PostgreSQL learning summary (11) - PostgreSQL commonly used high-availability cluster solutions
Biotin hydrazide HCl|CAS:66640-86-6|Biotin-hydrazide hydrochloride
学习笔记(8)DOM
基本SQL语句(一篇就够了)
cas:139504-50-0 美登素DM1|Mertansine|
多表的查询
A young man with strong blood and energy actually became a housekeeper. How did he successfully turn around and change careers?
52. [Bool type input any non-0 value is not 1 version reason]
HCIP9_BGP增加实验
TiFlash 存储层概览
HCIP第一天
Shell变成规范与变量
What is NoSQL?Databases for the cloud-scale future
Wang Xuegang - compiled shipment line file
mysqldump --set-gtid-purged=OFF