Unlock instant, AI-driven research and patent intelligence for your innovation.

Method and apparatus for querying information

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

Active Publication Date: 2022-07-15
BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF6 Cites 0 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
  • Method and apparatus for querying information
  • Method and apparatus for querying information
  • Method and apparatus for querying information

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0072] Example 1: The user has fixed query objects, 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] where 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 fixed query objects, 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 fixed query objects, such as fields col1, col2. Among them, 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 is "yyyy-MM-dd". If the user wants to query the data of the previous month of the month in which the selected date is located, 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] Among them, 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 acquiring the SQL template, the above-mentioned execution body can fi...

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

The embodiments of the present application disclose a method and an apparatus for querying information. A specific implementation of the method includes: in response to receiving a query request, obtaining a structured query language SQL template associated with the query request, wherein the query request includes a filter item value and a filter item identifier corresponding to the filter item value , the SQL template includes an SQL query statement, there is at least one specific part in the SQL query statement, and the specific part includes the target keyword and the filter item identifier; based on the filter item value and the filter item identifier corresponding to the filter item value, at least one specific part is Partly modify; determine the modified SQL query statement as the SQL statement to be executed, execute the SQL statement to be executed, and obtain the query result. This embodiment realizes the dynamic generation of the SQL statement to be executed, and improves the flexibility of information query.

Description

technical field [0001] The embodiments of the present application relate to the field of computer technologies, and in particular, to a method and an apparatus for querying information. Background technique [0002] At present, the existing information query methods usually simply bind the filter items displayed on the page with the fields in the data table. For example, there is a date filter item on the page, and the date filter item 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. SUMMARY OF THE INVENTION [0003] The embodiments of the present application propose a method and an apparatus for querying information. [0004] In a first aspect, an embodiment of the present application provides a method for qu...

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 Patents(China)
IPC IPC(8): G06F16/242
Inventor 张军刘一鸣
Owner BEIJING BAIDU NETCOM SCI & TECH CO LTD