We need to extract data to the treeview tree diagram below
The class of 2014
For the first time,
Class 1
Male
Female
Class 2
Male
Female
Class 3
Male
Female
The second
Class 1
Class 2
Class 3
The third time
Class 1
Class 2
Class 3
The class of 2015
For the first time,
The second
The class of 2016
Under normal circumstances, can achieve 2014 level of the parent node, and then can't get down, everybody to help see ah, the query is actually implement some conditions, such as I choose a certain of a test class boys or girls, will automatically into the dbgrid query data
CodePudding user response:
Didn't quite understand the LZ, feel your treeview screenshot of the table with you not matter much, tree you read data from the listCodePudding user response:
You can create a view would be link two tables to the treeCodePudding user response:
Level 3:1, TreeView tree points class - number - gender2, in the TreeView can obtain three characters: the class number gender
3, in the TreeView Onchange event, through the SQL statements, associated DBGrid can
SQL:='select * form the name of the table where XXX and BBB==class number and gender CCC=
Note:
In the first quarter on energy saving a character
In the second quarter on the energy saving two characters
In the third quarter on energy saving three characters
Conditional statements MAO characters, Settings,
CodePudding user response:
Estimates of the building Lord confused is that data onOne of the query keyword DISTINCT, usage at: http://www.w3school.com.cn/sql/sql_distinct.asp
So you can query to the table level how many years "level, and how much" time ", and how many times a "class"
Example: when the nodes selected
FROM the SELECT DISTINCT time table name
WHERE=TREENODETEXT