In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to get a certain period of time for oracle. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Oracle fetches the data of a certain time period. The specific code is as follows:
Select count (*), T. Grouping fields from (select t. *, to_char (t. Time, 'HH24') stime,to_char (t. Time, 'HH24mi') fz,to_char (time,' d') from A twhere time > = to_date ('2019-12-01) and ghsj=0800 a group by T. The grouping field to_char (time,'d') takes what day of the week the first day of each week is Sunday to_char (t. Time, 'HH24mi') take the current hour o_char (t. Time, 'HH24') take the hour of the current time
Ps:oracle has multiple records of the same data, and the one with the largest time is selected according to the condition.
1. The first way
Select max (t1.INVALID_TIME) from T_CUSTOMER T1 where t1.customer_code = '5101'
1. The second way
SELECT INVALID_TIME FROM (SELECT * FROM T_CUSTOMER WHERE customer_code='5101' ORDER BY INVALID_TIME desc) WHERE ROWNUM = 1
1. The third way
Select INVALID_TIME from T_CUSTOMER t where INVALID_TIME= (select max (INVALID_TIME) from T_CUSTOMER where customer_code='5101') and ROWNUM = 1
5. There are multiple maximum times without filtering
Select INVALID_TIME from T_CUSTOMER t wheret.INVALID_TIME = (select max (t1.INVALID_TIME) from T_CUSTOMER T1 where t1.customer_code = '5101') this is the end of the article on "how to get a certain period of time for oracle". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.