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 |
|
jaroot
Starting Member
46 Posts |
Posted - 2005-12-29 : 16:09:29
|
| What I'm trying to do is return multiple rows as single rows based on a grouping of a particular ID.Say you have a table with movies for instance:tblMovieID - TYPEID - MOVIENAME1 - 1 - LOTR12 - 1 - LOTR23 - 2 - JAWS14 - 2 - JAWS2I want to return this as two rows that look like thisTYPEID - MOVIENAME 1 - LOTR1, LOTR2 2 - JAWS1, JAWS2 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-12-29 : 16:19:54
|
| http://www.sqlteam.com/item.asp?ItemID=11021Tara Kizeraka tduggan |
 |
|
|
jaroot
Starting Member
46 Posts |
Posted - 2005-12-29 : 16:26:15
|
| Awesome.. thanks! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
i_love_techno
Starting Member
4 Posts |
Posted - 2005-12-30 : 11:16:58
|
quote: Originally posted by madhivanan Refer this also which uses Function approach http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx?Pending=trueMadhivananFailing to plan is Planning to fail
Heh, nice.. So simple too. For some reason I was using a recursive UDF to pull off the same thing, don't know why I didn't think about this route! It's a little cleaner, and probly faster. thx!Find happiness in listening to your discontent. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-02 : 01:45:27
|
>> It's a little cleaner, and probly faster. thx!Yes Function approach is much faster than other methods MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|