Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Create Function to Group Column and display as single column Expand / Collapse
Author
Message
Posted Wednesday, July 28, 2010 11:12 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, January 28, 2011 12:09 AM
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........................
Post #960485
Posted Thursday, July 29, 2010 2:21 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 2:40 AM
Points: 3,925, Visits: 5,110
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”
Post #960542
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse