To address the problem of users' lack of SQL query writing skills, Query Reverse Engineering (QRE) was proposed, where the goal of QRE is to generate a SQL statement based on a given database and query output table. SQUARES is one of the state-of-the-art models in the field, which enumerates constraint-compliant programs using a solver-based enumerator, and since the Solver randomly enumerates candidate programs, SQUARES synthesis is not very efficient. In this paper, we propose LGEQRE based on SQUARES, a learning-based approach to guide the enumeration of candidate programs. LGEQRE predicts the operators be required by neural network, sorts and deletes operators based on the prediction, and uses an Optimizer-based enumerator to enumerate programs according to the predicted probability of the operators. Under the same experimental conditions, the experimental results showed that LGEQRE increased the synthesis rate from 80% to 89.1% and reduced the average synthesis time from 251s to 117s compared to SQUARES.