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)
 How to query Hierarchical relationships.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-21 : 08:24:17
simon writes "hiye i'm using sqlServer 2000 on a windows 2000 pro.
Heres my problem, i've got a table name "PhoneNumbers" with "contactID, "personID", "ContactNumberType" and "ContactNumber" as fields.

personID can had multiple value, but contactID can only have 1, contactID is the primary key.

heres how my table looks like

contactID=1 personID=5 ContactNumberType=P ContactNumber=999
contactID=2 personID=5 ContactNumberType=H ContactNumber=991

when i display out the results, i get 2 rows. how do i assign a statement to display individual valuess of "P" and "H"?


Thanks for helping me out here..


Simon"

M.E.
Aged Yak Warrior

539 Posts

Posted - 2002-06-21 : 10:39:18
quote:
how do i assign a statement to display individual valuess of "P" and "H"?


Alot of reads and no posts... So I'll assume everyone is just like me on this one... wtf are you asking there? Could you reword the question or give us a slightly better idea of what you want?



-----------------------
Take my advice, I dare ya
Go to Top of Page

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2002-06-21 : 10:42:35
quote:

heres how my table looks like

contactID=1 personID=5 ContactNumberType=P ContactNumber=999
contactID=2 personID=5 ContactNumberType=H ContactNumber=991

when i display out the results, i get 2 rows. how do i assign a statement to display individual valuess of "P" and "H"?



Simon,
Do you mean you want a rowset that looks like:

PersonID ContactNumberP ContactNumberH
--------------------------------------
5 999 991
 


setBasedIsTheTruepath
<O>

Edited by - setbasedisthetruepath on 06/21/2002 10:43:04
Go to Top of Page
   

- Advertisement -