(EN) Embodiments of the invention provide a data query method and apparatus. The method comprises the steps of obtaining a query statement; wherein the query statement comprises parameter information; searching a preset template statement matched with the query statement, and obtaining preprocessing information corresponding to the template statement; generating a target execution statement by adoptingthe preprocessing information and the parameter information; and querying target data from a preset database by adopting the target execution statement. Therefore, the query statement sent by the user can be converted into the target execution statement, and the target execution statement is adopted to query the target data in the database, so that the database can directly execute the query taskwithout a statement analysis optimization process, and the query efficiency of the database is improved.
(ZH) 本申请实施例提供了一种数据查询方法和装置,所述方法包括:获取查询语句;其中,所述查询语句包括参数信息;查找与所述查询语句匹配的预设的模板语句,并获取所述模板语句对应的预处理信息;采用所述预处理信息以及所述参数信息,生成目标执行语句;采用所述目标执行语句,向预设的数据库查询目标数据。从而可以将用户发送的查询语句转换为目标执行语句,并采用所述目标执行语句向数据库查询目标数据,从而所述数据库可以无需经过语句解析优化过程,即可直接执行查询任务,提高了数据库的查询效率。