table is a top-up record table. Users generate a record for each top-up. I want to sum each user"s top-up within a period of time, sort it according to the total amount of each user"s top-up, and intercept the first few bits. The current sql statement is as follows:
but there is no intercept operation, sorting is not the order_by, of sql because it needs to be sorted according to the sum, now I want to realize the requirement through the sql statement and find the code. (the reason why you want to optimize is that too much data will cause sql statements to slow down, right? Or is the impact less significant, but will it slow down if the back-end is transferred from the front end to the front end? )