Click here to Skip to main content
15,880,543 members
Home / Discussions / Database
   

Database

 
GeneralRe: Null parent row parameter for addRow method, using typed dataset Pin
hoonzis26-Feb-07 23:22
hoonzis26-Feb-07 23:22 
Questiontsql table alias - performance? Pin
matthew.rowe22-Feb-07 13:25
matthew.rowe22-Feb-07 13:25 
AnswerRe: tsql table alias - performance? Pin
Colin Angus Mackay22-Feb-07 13:41
Colin Angus Mackay22-Feb-07 13:41 
AnswerRe: tsql table alias - performance? Pin
Pete O'Hanlon22-Feb-07 22:56
mvePete O'Hanlon22-Feb-07 22:56 
Questionconvert database Pin
shereem khaleel22-Feb-07 13:08
shereem khaleel22-Feb-07 13:08 
AnswerRe: convert database Pin
PSmith99927-Feb-07 9:32
PSmith99927-Feb-07 9:32 
Questionhow to combine column values Pin
tvfoto22-Feb-07 9:27
tvfoto22-Feb-07 9:27 
AnswerRe: how to combine column values Pin
Hesham Amin22-Feb-07 10:08
Hesham Amin22-Feb-07 10:08 
This is a technique to return items names a comma-separated values for each ID

create function GetItems(@id int)
returns varchar(1000)
As
Begin
declare @items varchar(1000)

Set @items=''
Select @items=@items+','+col1 from Items where ID=@ID

return @items

End
Go

this UDF returns a comma separated values for a given ID

then select the values with distinct IDs:
Select distinct ID,dbo.GetItems(ID) as items from items


results should look like:
777 ,itemx,itemy,itemz
888 ,itemx,itremy

you can display these results the way you want in your code.



Hesham A. Amin
blog

AnswerRe: how to combine column values Pin
tvfoto22-Feb-07 12:02
tvfoto22-Feb-07 12:02 
GeneralRe: how to combine column values Pin
tvfoto23-Feb-07 3:51
tvfoto23-Feb-07 3:51 
QuestionMany : Many Pin
lost in transition 22-Feb-07 7:05
lost in transition 22-Feb-07 7:05 
AnswerRe: Many : Many Pin
Hesham Amin22-Feb-07 9:55
Hesham Amin22-Feb-07 9:55 
GeneralRe: Many : Many Pin
lost in transition 22-Feb-07 11:34
lost in transition 22-Feb-07 11:34 
GeneralRe: Many : Many Pin
Colin Angus Mackay22-Feb-07 13:23
Colin Angus Mackay22-Feb-07 13:23 
AnswerRe: Many : Many Pin
Colin Angus Mackay22-Feb-07 13:20
Colin Angus Mackay22-Feb-07 13:20 
GeneralRe: Many : Many Pin
lost in transition 23-Feb-07 3:08
lost in transition 23-Feb-07 3:08 
AnswerRe: Many : Many Pin
Marcus J. Smith23-Feb-07 3:52
professionalMarcus J. Smith23-Feb-07 3:52 
QuestionGETDATE Pin
Sam Heller22-Feb-07 5:52
Sam Heller22-Feb-07 5:52 
AnswerRe: GETDATE Pin
Colin Angus Mackay22-Feb-07 5:59
Colin Angus Mackay22-Feb-07 5:59 
GeneralRe: GETDATE Pin
Sam Heller22-Feb-07 8:28
Sam Heller22-Feb-07 8:28 
GeneralRe: GETDATE Pin
Colin Angus Mackay22-Feb-07 11:31
Colin Angus Mackay22-Feb-07 11:31 
QuestionDynamic SQL Error Pin
Sam Heller22-Feb-07 5:08
Sam Heller22-Feb-07 5:08 
AnswerRe: Dynamic SQL Error Pin
Colin Angus Mackay22-Feb-07 5:24
Colin Angus Mackay22-Feb-07 5:24 
QuestionRe: Dynamic SQL Error Pin
andyharman22-Feb-07 5:28
professionalandyharman22-Feb-07 5:28 
AnswerRe: Dynamic SQL Error Pin
Sam Heller22-Feb-07 5:49
Sam Heller22-Feb-07 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.