当前位置:网站首页>[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
边栏推荐
- 【WPF绑定3】 ListView基础绑定和数据模板绑定
- MySQL master-slave configuration under CentOS
- VLAN advanced technology, VLAN aggregation, super VLAN, sub VLAN
- Node access to Alipay open platform sandbox to achieve payment function
- groutine
- 基于51单片机红外无线通讯仿真
- Shell-awk命令的使用
- 1-2 characteristics of nodejs
- Collect blog posts
- Freecodecamp ---- budget & category exercise
猜你喜欢
Detailed explanation of the penetration of network security in the shooting range
The new MySQL table has a self increasing ID of 20 bits. The reason is
Solution architect's small bag - 5 types of architecture diagrams
ClickHouse-表引擎
On lambda powertools typescript
【生活中的逻辑谬误】稻草人谬误和无力反驳不算证明
Detailed explanation of C webpai route
[PROJECT] small hat takeout (8)
Bottom processing of stack memory in browser
RPC核心概念理解
随机推荐
Your brain expands and shrinks over time — these charts show how
Use between nodejs modules
For the space occupation of the software, please refer to the installation directory
Baidu Map Case - modify map style
Basic case of Baidu map
BUG_ me
_ Mold_ Board_
Self use learning notes - connected and non connected access to database
websocket
Linux MySQL data timing dump
[markdown notes]
VsCode-Go
Further study of data visualization
Freecodecamp ---- budget & category exercise
Shortcut keys (multiline)
TypeError: set_ figure_ params() got an unexpected keyword argument ‘figsize‘
Shell-sort命令的使用
Using quartz under. Net core -- job attributes and exceptions of [4] jobs and triggers
Using quartz under. Net core -- operation transfer parameters of [3] operation and trigger
ASP. Net core configuration options (Part 1)