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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-03-31 : 08:47:27
|
| shane writes "Hello,I have written this SQL statement, and it works fine.SELECT dbo.items2.description, dbo.dogs.sections, dbo.items2.itemnumber, dbo.items2.catC, dbo.items2.price, dbo.items2.vendorFROM dbo.items2, dbo.dogsWHERE id = 'MMColParam' AND dbo.items2.catB = 'MMColParam' GROUP BY dbo.items2.vendor, dbo.items2.description, dbo.dogs.sections, dbo.items2.itemnumber, dbo.items2.catC, dbo.items2.pricehowever, it displays the data like this:(Section)(Vendor) (Itemnumber) (description)(Vendor) (Itemnumber) (description)(Vendor) (Itemnumber) (description)The vendors are grouped alphabetically which is fine, but i only want each vendor name listed one...like this:((Section)(Vendor)(Itemnumber) (description)(Itemnumber) (description)(Itemnumber) (description)(Vendor)(Itemnumber) (description)(Itemnumber) (description)(Itemnumber) (description)Any suggestions? I would really appreciate it..thank you.shane" |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-03-31 : 09:36:41
|
| That's really a display issue and should be handled in the front end. If you are passing XML to the front end, you could accomplish what you are doing by setting Vendor as the Parent Node and using for xml. Other than that, you need to handle it on the application side.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|
|
|