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 |
kiran
Starting Member
30 Posts |
Posted - 2006-10-11 : 19:14:54
|
I have a table like this:CREATE TABLE PAGES(ID CHAR(32), PAGE_NAME VARCHAR(150), DT DATETIME)PAGES-----GUID1 PAGE1 10/1/2006GUID1 PAGE2 10/2/2006GUID1 PAGE3 10/3/2006GUID2 PAGE1 10/1/2006GUID2 PAGE2 10/2/2006GUID3 PAGE1 10/1/2006GUID3 PAGE2 10/2/2006GUID3 PAGE3 10/3/2006GUID3 PAGE4 10/4/2006I want to get the output as:GUID1 PAGE1, PAGE2, PAGE3GUID2 PAGE1, PAGE2GUID3 PAGE1, PAGE2, PAGE3, PAGE4Unfortunately I cannot use any stored procedures or cursors to achive this output. I need to do with SELECT Query.Can anyone help on this?Thanks in advance. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-11 : 21:10:32
|
Note that if concatenated string exceeds 8000 characters, you need to use more than one variable.If you use front end application, you can do concatenation thereMadhivananFailing to plan is Planning to fail |
 |
|
kiran
Starting Member
30 Posts |
Posted - 2006-10-11 : 21:28:59
|
Thanks for your replies.I cannot use UDF either. I know it sucks but the system on which i am using does not allow to use this. |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-10-11 : 22:39:19
|
Homework?CODO ERGO SUM |
 |
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-10-12 : 07:15:55
|
quote: I cannot use UDF either. I know it sucks but the system on which i am using does not allow to use this.
SQL SERVER allows stored procs, cursors, and UDFs all day, every day. Therefor, this must be one of the following:1) Homework or2) Access maybe?Either way, sure looks like a cross tab report to me.EDIT: how could i MISS saying "FORMAT IN THE FRONT END". [Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
|
|
|
|