SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create Function to Group Column and display as single column


Create Function to Group Column and display as single column

Author
Message
londhe.kunal
londhe.kunal
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 31
Hi
Consider table Exhibitor

Exhibitor Table name
ID Column name
Name Column name
StallNo1 Column name
StallNo2 Column name
StallNo3 Column name
StallNo4 Column name
StallNo5 Column name

i want a generic function it accept ('tablename','Column order min ','Column order max') it return group of Column as single column.

when i used this function in select query it gave me group of value for Group Column.

Waiting For Replay........................
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8761 Visits: 7279
Please provide us with an example of what you have already tried.

also, are you in a position to normalise the table?
e.g.

Create table dbo.Exhibitor (
ID DataType
Name DataType
...
)
Create Table dbo.Stall
StallNo DataType
Exibitor DataType CONSTRAINT FK_Exibitor FOREIGN KEY REFERENCES dbo.Exibitor(ID)
....



____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search