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
 General SQL Server Forums
 New to SQL Server Programming
 HOWTO select several rows in one comma- separated

Author  Topic 

almu_alf
Starting Member

3 Posts

Posted - 2007-08-21 : 02:42:22
Hello!!

First of all, thank you in advance for helping me!!!

My problem is that I have a BBDD with a table like this (in Oracle and in MySql, both)

E.g.

+---------+-----------+
| groupId | serviceId |
+---------+-----------+
| grup1 | service1 |
| grup1 | service2 |
| grup1 | service3 |
| grup2 | service1 |
| grup2 | service2 |
+---------+-----------+

And I need to do a select o a procedure or something that returns me something like this:

+---------+------------------------------------------+
| groupId | serviceId |
+---------+------------------------------------------+
| grup1 | service1, service2, service3 |
+---------+------------------------------------------+

Is this possible in any way????

Than you very very much.

Almu

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-21 : 02:51:16
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254

Unless you are using SQL Server 2000. You haven't provided this important piece of information so I just winged it...


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-21 : 04:00:26
<<
My problem is that I have a BBDD with a table like this (in Oracle and in MySql, both)
>>

If you dont use SQL Server, then post at relevent forum

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

almu_alf
Starting Member

3 Posts

Posted - 2007-08-21 : 04:18:48
Sorry!

I thought this was a forum about SQL in general no only SQL Sever!!!

Ups! I'll look for the right place then!!!

Thank you very much!

Almu
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-21 : 04:37:57
You can try at www.dbforums.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

almu_alf
Starting Member

3 Posts

Posted - 2007-08-21 : 05:14:50
Thank you!!! I'll do it!!!
Go to Top of Page
   

- Advertisement -