A method and apparatus for querying information

A technology for querying information and indicating information, applied in the field of querying information, it can solve problems such as low flexibility, and achieve the effect of improving flexibility and realizing dynamic generation.

Active Publication Date: 2018-12-07
BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF6 Cites 10 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This query method is very simple, but less flexible

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and apparatus for querying information
  • A method and apparatus for querying information
  • A method and apparatus for querying information

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0072] Example 1: The user has a fixed query object, such as fields col1, col2. The format of the value of the field date in data table A is "yyyyMMdd", where y can represent the year, M can represent the month, and d can represent the day. The format of the value of the date filter item is "yyyy-MM-dd". Users can write the following SQL query statements:

[0073] select col1, col2

[0074] from A

[0075] where{date[conditions._date(number)]}

[0076] Among them, the specific part in the where clause is {date[conditions._date(number)]}. The first indication information in the specific part is number.

example 2

[0077] Example 2: The user has a fixed query object, such as fields col1, col2. The format of the value of the field date in data table A is "yyyyMMdd", and the format of the value of the date filter item is "yyyy-MM-dd". If the user wants to query the data of the previous day of the selected date, the user can write the following SQL query statement, for example:

[0078] select col1, col2

[0079] from A

[0080] where{date=[conditions._date(-1.number)]}

[0081] Wherein, the specific part in the where clause is {date=[conditions._date(-1.number)]}. The first indication information in the specific part is number, and the second indication information is -1.

example 3

[0082] Example 3: The user has a fixed query object, such as fields col1, col2. Wherein, the field month is a month field, and the value of this field is a value of numeric type. The format of the value of the field date is "yyyyMMdd", and the format of the value of the date filter item is "yyyy-MM-dd". If the user wants to query the data of the previous month of the selected date, the user can write the following SQL query statement, for example:

[0083] select col1, col2

[0084] from A

[0085] where{month=[conditions._date(-30.month.number)]}

[0086] Wherein, the specific part in the where clause is {month=[conditions._date(-30.month.number)]}. The first indication information in the specific part is number, the second indication information is -30, and the third indication information is month.

[0087] In some optional implementation manners of this embodiment, after the execution subject obtains the SQL template, it can find out the target specific part in the SQ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

A method and an apparatus for query information are disclosed in the embodiment of the present application. One embodiment of the method includes: in response to receiving a query request, obtaining astructured query language SQL template associated with the query request, wherein the query request comprises a filter item value and a filter item identification corresponding to the filter item value, the SQL template comprises an SQL query statement, at least one specific part exists in the SQL query statement, and the specific part comprises a target keyword and a filter item identification;modifying at least one specific part based on the filter item value and the filter item identifier corresponding to the filter item value; determining the modified SQL query statement as the SQL statement to be executed, executing the SQL statement to be executed, and obtaining a query result. The implementation mode realizes the dynamic generation of SQL statements to be executed, and improves the flexibility of information query.

Description

technical field [0001] The embodiment of the present application relates to the field of computer technology, and specifically relates to a method and an apparatus for querying information. Background technique [0002] At present, the existing information query method usually simply binds the filter items displayed on the page to the fields in the data table. For example, there is a date filter item on the page, which is associated with the date field in data table A. When the user selects a certain value of the date filter item on the page to trigger the information query, the data whose value of the date field is the value of the value is directly queried from the data table A. This query method is simple, but less flexible. Contents of the invention [0003] The embodiment of the present application proposes a method and device for querying information. [0004] In the first aspect, the embodiment of the present application provides a method for querying information...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 张军刘一鸣
Owner BEIJING BAIDU NETCOM SCI & TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products