Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 2nd, 2005, 02:48 AM
Registered User
 
Join Date: Aug 2005
Location: dalals, texas, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to suraj Send a message via Yahoo to suraj
Default simple query for displaying groups...

Hi all,
I'm a beginner in sqlserver2000.
I have a small question.
I have a small table as follows:
company products
------- --------
123 pencil
123 ink
123 fillers
123 cartridge
124 apple
124 orange

The objective is to display company and its products separated by commas.
123 pencil,ink,fillers,cartridge
124 apple,orange

I did it by creating a cursor by storing those two values in two temp variables and going row by row appending the characters. Since cursors are said to be slow, can this be done by select statements? I don't want to create another table for the same data this table has.
thank you for any ideas.
suraj

Reply With Quote
  #2 (permalink)  
Old September 2nd, 2005, 06:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

I answered this a couple years ago (wow, has it been that long?). Take a look at:

http://p2p.wrox.com/topic.asp?TOPIC_ID=1787

and see if that helps you...

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Query Need Help ~Bean~ SQL Language 2 June 27th, 2005 11:22 AM
Simple Tomcat Query? Baztec Apache Tomcat 0 January 13th, 2004 11:38 PM
Simple Query/Display ABATES VS.NET 2002/2003 1 August 10th, 2003 05:54 AM



All times are GMT -4. The time now is 02:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.