Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TOUGH Select Statement @_@ HELP!!!

Status
Not open for further replies.

rmahawaii

Programmer
Oct 21, 2002
29
HK
I have been thinking and trying this SQL statement in SQL2000 for the whole day. So far, I am retrieving all the details in a deal. This is simple. The problem is each detail have 5 customers link to this deal. My problem is how can I display all the 5 customers information and 1 deal record in just ONE row????

This what I have right now:

Deal_ID CustomerName
-------------- -------------
PD0000000025 Vincent
PD0000000025 Karen
PD0000000025 Ronald
PD0000000025 Wayne
PD0000000025 Smooch

This is what I WANT ^-^

Deal_ID CName1 CName2 CName3 CName4 CName5
--------- -------- -------- -------- -------- ----------
PD000025 Vincent Karen Ronald Wayne Smooch

Thanks in advance.
 
I recommend asking SQL 2000 specific questions in the SQL Server forum. There is a lot of discussion there about Cross Tab queries. You really want to create a Cross Tab query. Check Thread183-451930. It deals with Cross Tabs. Terry L. Broadbent - DBA
SQL Server Page:
If you want to get the best answer for your question read faq183-874.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top