Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 parent child relationship in a table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-06-13 : 22:01:11
chris writes "I have two tables Security & Holdings. Simplified layouts are:
Security as Colunms Sec ID, Type, Value Date,Parent, Maturity Date.
Holdings as Columns Sec ID, Value Date, Units, Client.

Security Types 'OP' have an underlying security associated with them, its id is stored in the Parent column. ie in these cases there exists an implied child/parent relationship between 'Parent' and sec Id of another row within the Security Table.

Problem I need to know the simplest method to extract 'OP' holdings on a specific date, where the maturity date of the underlying security not > 3 years from today.

Note there will always be a row in the Security table for the underlying security on the same value date

Utimately the query will be used in SQL 7 DTS to output the answer to a .CSV file "
   

- Advertisement -