Data batch query data some time ago due to activities of online projects, we found that when we requested data from a third-party system, the requested data volume reached more, the requested data is in the form of an Http request. I did not expect that there would be so much data in advance, so I can only request data from other systems in batches, with 200 requests each time. The specific situation is as follows:
Data batch query data some time ago due to activities of online projects, we found that when we requested data from a third-party system, the requested data volume reached more, the requested data is in the form of an Http request. I did not expect that there would be so much data in advance, so I can only request data from other systems in batches, with 200 requests each time. The specific situation is as follows:
Data batch query data some time ago due to activities of online projects, we found that when we requested data from a third-party system, the requested data volume reached more, the requested data is in the form of an Http request. I didn't expect that there would be so much data in advance, so I could only request data from other systems in batches, with 200 requests each time. The specific situation is: there is a table in the database. The main fields are user_id (User Name) and count (item quantity). The system requires that the user's item quantity be updated in real time, however, the interface for saving the number of items is not in its own system, so you need to remember the system request data, mainly how to obtain the user user_id each time without repeating. We mainly learn how to use Database SQL statements:
Select top 200 user_id from (SELECT (Row_number () OVER (order by user_id) as ix, user_idFROM [xxx]. [dbo]. t_world_cup_exchange_user_flag_list group by user_id) ttwhere tt. ix >#{ index, jdbcType = VARCHAR}
We mainly use database functions. Row_number generates a specific serial number for the returned result set. This function can be used to request data with 200 different users each time, such as from 0 ~ 200,201 ~ 401,401 ~ 601 ...... This sequence starts to select the user ID you need. Of course, you need to save the index cursor value in your program and keep it in a loop. --- The road is long, and I will go up and down