当前位置:网站首页>[difference between Oracle and MySQL]
[difference between Oracle and MySQL]
2022-04-23 17:11:00 【ZHZHK001】
Here is the custom directory title
1.sysdate
-- oracle
SELECT SYSDATE FROM DUAL
-- mysql
SELECT SYSDATE() FROM DUAL
-- sentence 3
SELECT SYSDATE() , LNS_END_DATE,SYSDATE() - LNS_END_DATE FROM MRS_CUST_LNS_DUE
-- sentence 4
SELECT CURDATE() , DATE(LNS_END_DATE),CURDATE() - DATE(LNS_END_DATE) FROM MRS_CUST_LNS_DUE
The above sentence 3 The result is wrong , Need to change to a statement 4 Can only be
2. Line number problem
MYSQL No, rowner function
-- mysql The sentence used is :
SELECT B.content FROM
( SELECT T.content FROM T1 T WHERE T.text_type = 1 ORDER BY T.gmt_create desc ) B LIMIT 4
-- oracle The sentence is :
SELECT content FROM
( SELECT T.content FROM T1 T WHERE T.text_type = 1 ORDER BY T.gmt_create desc ) WHERE ROWNER <4
3. Date question TRUNC An alternative
-- ORACLE
-- Get the first day of the month TRUNC
SELECT T2.BRANCH_NAME, T3.PROD_NAME,SUM(T1.VALID_NUM) C
FROM MRS_ELCT_SUMMARY T1
LEFT JOIN MRS_BRANCH T2 ON T1.BRANCH_ID = T2.ID
LEFT JOIN MRS_ELCT_PRODUCT T3 ON T1.PRODUCT_ID = T3.ID
WHERE TRUNC(T1.DATA_DATE,'mm') = TRUNC(SYSDATE,'mm')
GROUP BY T2.BRANCH_NAME, T3.PROD_NAME;
--MYSQL No, TRUNC function , The meaning of the equality of year and month is the same as that of the first day of a certain year and month
SELECT T2.BRANCH_NAME, T3.PROD_NAME,SUM(T1.VALID_NUM) C
FROM MRS_ELCT_SUMMARY T1
LEFT JOIN MRS_BRANCH T2 ON T1.BRANCH_ID = T2.ID
LEFT JOIN MRS_ELCT_PRODUCT T3 ON T1.PRODUCT_ID = T3.ID
WHERE date_format(T1.DATA_DATE, '%Y%m') = date_format(CURDATE(), '%Y%m')
GROUP BY T2.BRANCH_NAME, T3.PROD_NAME
版权声明
本文为[ZHZHK001]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230553251257.html
边栏推荐
- Summary of common websites
- Milvus 2.0 質量保障系統詳解
- Net standard
- Baidu Map Case - modify map style
- Kingdee Cloud Star API calling practice
- Detailed explanation of C webpai route
- Shell - introduction, variables, and basic syntax
- Promise (I)
- TypeError: set_ figure_ params() got an unexpected keyword argument ‘figsize‘
- How vscode compares the similarities and differences between two files
猜你喜欢
01-初识sketch-sketch优势
C语言函数详解
Perception of linear algebra 2
. net cross platform principle (Part I)
CentOS MySQL multi instance deployment
RPC核心概念理解
XTask与Kotlin Coroutine的使用对比
For the space occupation of the software, please refer to the installation directory
Using quartz under. Net core -- operation transfer parameters of [3] operation and trigger
Detailed explanation of Milvus 2.0 quality assurance system
随机推荐
Oninput one function to control multiple oninputs (take the contents of this input box as parameters) [very practical, very practical]
Generate random numbers with high quality and Gaussian distribution
[C#] 彻底搞明白深拷贝
Clickhouse table engine
Paging SQL
Devexpress GridView add select all columns
Using quartz under. Net core -- operation transfer parameters of [3] operation and trigger
Further optimize Baidu map data visualization
基于51单片机红外无线通讯仿真
Collect blog posts
matlab如何绘制已知公式的曲线图,Excel怎么绘制函数曲线图像?
Shell-cut命令的使用
Wiper component encapsulation
Use of shell awk command
Basic case of Baidu map
ClickHouse-数据类型
freeCodeCamp----shape_ Calculator exercise
[markdown notes]
Variable length parameter__ VA_ ARGS__ Macro definitions for and logging
1-2 characteristics of nodejs