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
 Transact-SQL (2000)
 Count / Number each person in a property

Author  Topic 

amgrace
Starting Member

30 Posts

Posted - 2006-10-10 : 06:21:56
Hi,
Can you help pls.

I have a property database which contains details of the main tenant (Client) plus any other relations living with them (e.g. partner, 1st Daughter, Mother, 2nd Son etc).

How can i write a query that groups on property and numbers the person(s) in each of these properties i.e the main tenant (client) will have 1 in the field next to it and any other relations in the same property will have the susequent number 2, 3, 4 etc next to them e.g

Property1 Client 1
Son 2
Mother 3

Property2 Client 1
Partner 2
1st Son 3

Thank you

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-10-10 : 06:25:39
can you post your table structure with the sample data and the result that you want ?


KH

Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-10-10 : 06:45:53
which is the table from where you will come to know what is the description of the property, for
instance for instance 1 means client, 2 means partner, 3 means 1st son

or this is understood?

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-10-10 : 09:56:19

http://www.nigelrivett.net/RetrieveTreeHierarchy.html


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -