MySQL tree data query method and system based on closure table
A data query and closure table technology, applied in the field of data query, can solve problems such as low efficiency and occupation, and achieve the effect of reducing the number of connections to MySQL and good portability
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment
[0048] A kind of MySQL tree data query method based on closure table provided by the present invention comprises the following steps:
[0049] Step 1: Insert the tree data into the sys_menu table;
[0050] Said step 1 includes:
[0051] Step 1.1: Prepare data, define variables, and add child node 5 to the node with pid 4;
[0052] Step 1.2: Write sql, the specific form is: insertintosys_menu(id,pid) select5, pidfromsys_menu_relationwhereid=4
[0053] unionall
[0054] select4,4
[0055] The data of the final sys_menu table is as follows:
[0056] id pid 4 4 5 4
[0057] Step 2: Query all child nodes whose id is 4;
[0058] select *fromsys_menu_relationwherepid=4;
[0059] Step 3: Query all parent nodes whose id is 4;
[0060] select *fromsys_menu_relationwhereid=4
[0061]Step 4: Delete all child nodes with id 4, including yourself;
[0062] deletefromsys_menu_relationwhereidin(selectidfromsys_menu_relationwherepid=4)
[0063] Such as figu...
PUM

Abstract
Description
Claims
Application Information

- Generate Ideas
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com