History tree. [message #19440] |
Mon, 18 March 2002 00:57 |
OeCrE
Messages: 1 Registered: March 2002
|
Junior Member |
|
|
Hi!
I have a problem.
I must rewrite entirely an application write in VB.
The pricipal topic of this application is representing and manipulating an eletrical plant. The main part of the interface is a treeview that schematize the connection from the power station to every house connected to the elettrical web.
I must archive - second by second - all changement introduced in the plant. For every black-out or for every work of manutention is necessary modify the schema of the power web.
I have projected a DB like this:
1 - A table for nodes involved in the tree
2 - A table for the assets (storicized)
3 - A table for the possibility of the asset
Eg.
-1- Nodes
nod_id nod_desc
0 root
1 central
2 cable1
3 cable2
4 house1
5 house2
6 house3
7 house4
99 trashbin
-2- Assets
fat_id son_id date
0 1 01/01/1900 00.00.00
0 99 01/01/1900 00.00.00
1 2 01/01/2000 12.00.00
1 3 01/01/2000 12.00.00
2 4 01/01/2000 12.00.00
2 5 01/01/2000 12.00.00
3 6 01/01/2000 12.00.00
3 7 01/01/2000 12.00.00
99 6 01/02/2000 16.25.10
2 7 01/03/2000 17.10.00
-3- Possibility
p_fat_id p_son_id p_date
0 1 01/01/1900 00.00.00
0 99 01/01/1900 00.00.00
1 2 01/01/2000 12.00.00
1 3 01/01/2000 12.00.00
2 4 01/01/2000 12.00.00
2 5 01/01/2000 12.00.00
2 6 01/01/2000 12.00.00
2 7 01/01/2000 12.00.00
3 4 01/01/2000 12.00.00
3 5 01/01/2000 12.00.00
3 6 01/01/2000 12.00.00
3 7 01/01/2000 12.00.00
99 4 01/01/2000 12.00.00
99 5 01/01/2000 12.00.00
99 6 01/01/2000 12.00.00
99 7 01/01/2000 12.00.00
I must have the possibility of interrogate the DB and retrieve a specific asset at a specific hour and date.
Which is the best query that I can use for that?
I spent month to compile a store or a sql statement that perform this request in an acceptable time...
Can you help me!!
e-mail me to mcrespi@csc.com
Marco Crespi from Italy
|
|
|
|