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.
| Author |
Topic |
|
IanSouter
Starting Member
1 Post |
Posted - 2003-02-19 : 19:41:00
|
| Hi all,I built a view in SQL Server 2000 that returns records that are exactly alike, except for one field, so multiple records are returned. I would like to combine the offending field into one.For example:My View Returns:ID Name Address1 TypeOfCustomer======================================================22 Smith 1 Main St. Gadgets22 Smith 1 Main St. OodjitsBut I Would Like it to Return:ID Name Address1 TypeOfCustomer======================================================22 Smith 1 Main St. Gadgets/OodjitsI've been trying multiple approaches in SQL Server 2000 (to include cross-tab queries, user-defined functions, and more), but am so far unable to complete my task.Any ideas?Thanks a lot,Ian |
|
|
ValterBorges
Master Smack Fu Yak Hacker
1429 Posts |
Posted - 2003-02-19 : 20:36:09
|
| What is your final goal?What will be the front end to your data?Have you thought about what would TypeOfCustomer look like if you had many records :22 Smith 1 Main St. Gadgets/Oodjits/Gatgets2/Gatgets3/Gatgets4I would suggest that if you are using a report tool like access reports or crystal reports that you return the data from your view and have the the report group your data on id and display id,name,address at the top followed by a list of TypeOf Customerie:Smith 1 Main St.GadgetsOodjitsCustomer2Address 2Type1Type2...TypenHowever if you truly feel that your way would be best then hereis an article that might help you obtain your sethttp://www.sqlteam.com/item.asp?ItemID=11021Edited by - ValterBorges on 02/19/2003 20:38:20 |
 |
|
|
|
|
|