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

Hierarchical query method and device, server and storage medium

A server and hierarchical technology, applied in the database field, can solve problems such as no implementation plan given

Inactive Publication Date: 2018-07-27
SHANGHAI DAMENG DATABASE
View PDF3 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In the prior art, only the syntax and functions of hierarchical query are given, but no specific implementation scheme is given

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
  • Hierarchical query method and device, server and storage medium
  • Hierarchical query method and device, server and storage medium
  • Hierarchical query method and device, server and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0029] figure 1 It is a flow chart of a method for hierarchical query provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of performing hierarchical query on data in a database. The method can be executed by a device for hierarchical query, which can be performed by It can be realized by software and / or hardware, and generally can be integrated in equipment such as a database server. The method specifically includes the following steps:

[0030] Step 101, obtaining a hierarchical query statement.

[0031] Among them, the basic function of the hierarchical query is to use each row of data in the table as the root node, traverse and output the data corresponding to all the nodes of the subtree rooted at the current root node. Extended functions may include designating a root node, filtering data participating in hierarchical queries, and so on.

[0032] When the user needs to perform a hierarchical query, he can input a hierarchica...

Embodiment 2

[0061] Embodiment 2 of the present invention provides a hierarchical query method, and this embodiment is an example based on the foregoing embodiments. In this embodiment, the table to be queried is table T as an example, and the data in table T is as follows:

[0062] Data in Table 1 Table T

[0063]

[0064]

[0065] According to the query condition PRIOR ID=PID, it can be seen that the tree structure corresponding to the data in table T is as follows figure 2 shown. In this embodiment, an operator CNNTB may be used to realize the hierarchical query function, and output the hierarchical query result and the corresponding hierarchical value of each row of result records. Hierarchical query is essentially a special self-join query. The data for hierarchical query can be a table (such as table T) or the connection of at least two tables.

[0066] The method specifically includes the following steps:

[0067] The obtained hierarchical query statement is "SELECT*FROM ...

Embodiment 3

[0088] image 3 It is a schematic structural diagram of a device for hierarchical query provided by Embodiment 3 of the present invention. This embodiment is applicable to the case of performing hierarchical query on data in a database. The device can be implemented by software and / or hardware, and generally can be integrated In equipment such as database servers. Such as image 3 As shown, the device for hierarchical query in this embodiment includes: a query statement acquisition module 301 , a query determination module 302 , a driving line acquisition module 303 , a hierarchical query module 304 and a recursive module 305 .

[0089] Wherein, the query statement acquisition module 301 is used to acquire hierarchical query statements;

[0090] A query determination module 302, configured to determine the table to be queried and the query condition according to the hierarchical query statement;

[0091] A driving row obtaining module 303, configured to obtain a row of data...

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

An embodiment of the invention discloses a hierarchical query method and device, a server and a storage medium. The method includes: S1, acquiring a hierarchical query sentence; S2, according to the hierarchical query sentence, determining a to-be-inquired table and query conditions; S3, acquiring a row of data from the to-be-inquired table to serve as a driving row; S4, according to the query conditions, determining data meeting the query conditions in a manner of being combined with the driving row from the to-be-inquired table, pressing the data into a stack, and outputting the data of thedriving row; S5, taking a row of data popped up from the stack as a driving row, executing the S4 until the data in the stack are processed completely, and returning to execute the S3 until all data in the to-be-inquired table are processed completely. By the method, hierarchical query is realized, and a data set of a treelike structure is returned.

Description

technical field [0001] Embodiments of the present invention relate to database technology, and in particular to a method, device, server and storage medium for hierarchical query. Background technique [0002] Hierarchical query is a database query function that uses tree traversal to obtain tree-structured data collections to obtain tree hierarchical relationship reports. [0003] Hierarchical query is very convenient for processing hierarchical data with a tree structure, and is mainly used to return a data set, which has a tree relationship. In the prior art, only the syntax and functions of the hierarchical query are given, but no specific implementation scheme is given. Contents of the invention [0004] In view of this, embodiments of the present invention provide a method, device, server and storage medium for hierarchical query, so as to implement hierarchical query. [0005] In the first aspect, the embodiment of the present invention provides a method for hiera...

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
CPCG06F16/2246G06F16/242G06F16/24566
Inventor 张钦朱仲颖宋鑫
Owner SHANGHAI DAMENG DATABASE