Home » SQL & PL/SQL » SQL & PL/SQL » History tree.
History tree. [message #19440] Mon, 18 March 2002 00:57 Go to next message
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
Re: History tree. [message #19442 is a reply to message #19440] Mon, 18 March 2002 01:17 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
select * from assets
where p_date=?
Previous Topic: Oracle Suitable data type
Next Topic: problem
Goto Forum:
  


Current Time: Thu Mar 28 21:11:09 CDT 2024