Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The latest time data in the database fetch table

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following is a memo only

Suppose there is the following table [FM_ALARM]

RES_ID : Unique identification of the resource OCCUR_TIME : Time of occurrence (millisecond timestamp)SEVERITY : Alarm level

The data changes in real time. If I want to take out the latest record of all the data, I can use the following SQL

select res_id, severity from fm_alarm t where not exists (select 1 from fm_alarm where t.res_id = res_id and t.occur_time < occur_time)

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report