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

Which qualification certificates can be filtered by MySQL statement and Java code?

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

Share

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

The following mainly brings you MySQL statements and Java code which qualifications can achieve filtering enterprise employees, I hope these contents can bring you practical use, this is also my editing MySQL statements and Java code which qualifications can achieve filtering enterprise employees The main purpose of this article. Okay, no more nonsense, let's just look at the following.

In enterprise ERP, each employee has multiple qualification certificates. The qualification certificates have the main attributes of type, name and registration time, as well as change time and end time. Now there is a requirement that when employees view their own information in the system: the qualification certificates of the same type, name and registration time shall be displayed with the latest change time, and the rest shall not be displayed.

Data source: SAP production system is obtained through RPC;

text

The following is the main structure of the table (mobile phone display may exist replacement phenomenon):

If you add an identifier to the latest record in this place, for example, add a field to display x, and use sql to directly output the result when filtering, it is quite convenient. I asked my SAP development colleagues: no;

ideas

The code is not novel, just say my thoughts (there may also be some problems):

1. First, use MySQL statement GROUP BY to group the results of three fields; grouping results: divide the data into groups according to the requirements, and the data in each group is changed according to the time. The latest one is above (that is, the one that meets the requirements is at the top).

2. Java code gets the dataset and processes it;

3. As mentioned above, if the first item meets the requirements, traverse the dataset, set all elements to the same element with the characteristics of List, and keep consistent with the first item;

4. Weight removal;

This small requirement was fulfilled in a simple way;

summary

To sum it up,

1. Grouping first, and the grouped data are arranged in descending order of time;

2. Then process the List with Java code, and set the values of the elements of the list to be consistent in a traversal manner;

3. Remove the list;

For the above MySQL statements and Java code which qualifications can achieve filtering enterprise employees, do you think it is very helpful? If you need to know more, please continue to pay attention to our industry information, I believe you will like these contents.

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