orcale查询踩的坑(Orcale query stepped on the pit)




First of all, this is a production problem. It uses the storage process under orcale package.

The process is as follows: Recently, the business verified the data, operated on the page, called the stored procedure to calculate the data, exported the excel table after the calculation is completed, and then queried the production and found the saved exception log. It was found that multiple sub queries returned. I probably know the reason. The operation was as fierce as a tiger. It was sent to the production and then the calculation was carried out. The result was still empty. The query exception record was still the wrong one. It was solved immediately. Check the code and do the unique processing of sub query. It should be all right. The problem lies in the final summary statement. Guess what, it’s really here. This problem is a little hidden. Take out the SQL alone and replace the parameters with the corresponding arguments. There is no problem with a query. Is it square again? Now it’s the key. Normally, queries are paged by default (MySQL checks the whole). When querying the first 100 items, it is normal. When querying 1000 items, the above error is reported. This is a personal experience. Write it down. Once the problem is found, it will be easy to solve. The difficult thing is how to locate the problem ~