Click here to Skip to main content
15,911,132 members
Home / Discussions / Database
   

Database

 
JokeRe: importing data from an xml into sql server 2005 Pin
Paul Conrad9-Dec-07 5:32
professionalPaul Conrad9-Dec-07 5:32 
QuestionHow to get this relation(need Sql query)? Pin
Imran Khan Pathan5-Dec-07 18:47
Imran Khan Pathan5-Dec-07 18:47 
AnswerRe: How to get this relation(need Sql query)? Pin
Rajkamal_dfine8-Dec-07 4:57
Rajkamal_dfine8-Dec-07 4:57 
GeneralSQL select up to the last 6 dates worth of an order Pin
totig5-Dec-07 8:15
totig5-Dec-07 8:15 
GeneralRe: SQL select up to the last 6 dates worth of an order Pin
Michael Potter5-Dec-07 8:33
Michael Potter5-Dec-07 8:33 
GeneralSelecting date range Pin
tthellebuyck5-Dec-07 3:22
tthellebuyck5-Dec-07 3:22 
GeneralRe: Selecting date range Pin
coolestCoder5-Dec-07 4:09
coolestCoder5-Dec-07 4:09 
QuestionHow to concatenate all columnB where columnA are the same? USING SQL 2005[modified] Pin
Support1235-Dec-07 2:32
Support1235-Dec-07 2:32 
Hi, i have data like this in temp table

Owner - DocumentPath
1 - c:\reports\fileA
1 - c:\reports\fileB
1 - c:\reports\fileC
2 - c:\reports\temp\FileA
2 - c:\reports\fileA
2 - c:\reports\fileB
AND SO ON....

i would like to know...
Is it possible to concatenate all DocumentPath column's into single column for each Owner ?

so i would have a new temp table that looks like this (if possible... this is still theoretical)
Owner - DocumentPaths
1 - c:\reports\fileAc:\reports\fileBc:\reports\fileC
2 - c:\reports\temp\FileAc:\reports\fileAc:\reports\fileB
AND SO ON....

The reason i want to do this is because i need all the file paths in one line in one field on a report later... I thought i could PIVOT the data and then concatenate them...

OR

Is it possible to select only the top 3 (ordered by Modified Date DESCENDING) for each Owner???

like:
SELECT TOP 3 Owner, DocumentPath<br />
FROM #tempTableDocPath<br />
ORDER BY Owner ASC,Modified DESC<br />

BUT for each owner show top 3 (if they have three)

AND then Is it possible ONCE AGAIN to CONCATENATE the DocumentPath column into one column (in a new table / tempTable)?
like this:
Owner - DocumentPath
1 - c:\reports\fileAc:\reports\fileBc:\reports\fileC
2 - c:\reports\temp\FileAc:\reports\fileAc:\reports\fileB
AND SO ON....

Thank you in advance. I hope i put it all down clearly Confused | :confused:

"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

modified on Wednesday, December 05, 2007 9:19:40 AM

AnswerRe: How to concatenate all columnB where columnA are the same? USING SQL 200 Pin
coolestCoder5-Dec-07 4:03
coolestCoder5-Dec-07 4:03 
QuestionRe: How to concatenate all columnB where columnA are the same? USING SQL 200 Pin
Support1235-Dec-07 18:28
Support1235-Dec-07 18:28 
GeneralRe: How to concatenate all columnB where columnA are the same? USING SQL 200 Pin
coolestCoder7-Dec-07 4:00
coolestCoder7-Dec-07 4:00 
QuestionIs this a viable stored procedure? Pin
Ranger495-Dec-07 2:27
Ranger495-Dec-07 2:27 
AnswerRe: Is this a viable stored procedure? Pin
pmarfleet5-Dec-07 3:18
pmarfleet5-Dec-07 3:18 
GeneralRe: Is this a viable stored procedure? Pin
Ranger495-Dec-07 5:38
Ranger495-Dec-07 5:38 
GeneralRe: Is this a viable stored procedure? Pin
Pete O'Hanlon5-Dec-07 10:41
mvePete O'Hanlon5-Dec-07 10:41 
QuestionConnecting from VB.NET to an online mySQL server? Pin
Benny_Lava5-Dec-07 1:54
Benny_Lava5-Dec-07 1:54 
AnswerRe: Connecting from VB.NET to an online mySQL server? Pin
Pete O'Hanlon5-Dec-07 10:44
mvePete O'Hanlon5-Dec-07 10:44 
Generaldatabase design Pin
avvaru.murali5-Dec-07 1:35
avvaru.murali5-Dec-07 1:35 
GeneralRe: database design Pin
coolestCoder5-Dec-07 4:13
coolestCoder5-Dec-07 4:13 
Generaldatabase design Pin
avvaru.murali5-Dec-07 1:22
avvaru.murali5-Dec-07 1:22 
GeneralRe: database design Pin
Ujjaval Modi5-Dec-07 1:29
Ujjaval Modi5-Dec-07 1:29 
GeneralRe: database design Pin
avvaru.murali5-Dec-07 1:32
avvaru.murali5-Dec-07 1:32 
GeneralRe: database design Pin
Ujjaval Modi5-Dec-07 1:39
Ujjaval Modi5-Dec-07 1:39 
GeneralRe: database design Pin
avvaru.murali5-Dec-07 1:42
avvaru.murali5-Dec-07 1:42 
GeneralRe: database design Pin
Ujjaval Modi5-Dec-07 1:44
Ujjaval Modi5-Dec-07 1:44 

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.