Click here to Skip to main content
15,897,704 members
Home / Discussions / Database
   

Database

 
Questionsql server data transferring?? Pin
Dotnetkanna22-Jul-08 21:34
Dotnetkanna22-Jul-08 21:34 
QuestionMultiple processes with the same ID Pin
JacquesDP22-Jul-08 21:05
JacquesDP22-Jul-08 21:05 
AnswerRe: Multiple processes with the same ID Pin
Wendelius23-Jul-08 6:03
mentorWendelius23-Jul-08 6:03 
QuestionRe: Multiple processes with the same ID Pin
JacquesDP23-Jul-08 18:18
JacquesDP23-Jul-08 18:18 
AnswerRe: Multiple processes with the same ID Pin
Wendelius23-Jul-08 18:43
mentorWendelius23-Jul-08 18:43 
GeneralRe: Multiple processes with the same ID Pin
JacquesDP23-Jul-08 18:47
JacquesDP23-Jul-08 18:47 
GeneralRe: Multiple processes with the same ID Pin
Wendelius23-Jul-08 18:49
mentorWendelius23-Jul-08 18:49 
QuestionStore files in database Pin
kashif63422-Jul-08 20:22
kashif63422-Jul-08 20:22 
AnswerRe: Store files in database Pin
Vimalsoft(Pty) Ltd23-Jul-08 6:02
professionalVimalsoft(Pty) Ltd23-Jul-08 6:02 
AnswerRe: Store files in database Pin
DerekFL25-Jul-08 8:28
DerekFL25-Jul-08 8:28 
QuestionReg:Integral Accounting Enterprise Pin
Member 384581522-Jul-08 4:53
Member 384581522-Jul-08 4:53 
AnswerRe: Reg:Integral Accounting Enterprise Pin
Ashfield22-Jul-08 8:46
Ashfield22-Jul-08 8:46 
GeneralSSIS Configurations Pin
Mycroft Holmes21-Jul-08 23:44
professionalMycroft Holmes21-Jul-08 23:44 
GeneralRe: SSIS Configurations Pin
SimulationofSai22-Jul-08 8:48
SimulationofSai22-Jul-08 8:48 
GeneralRe: SSIS Configurations Pin
Mycroft Holmes22-Jul-08 16:11
professionalMycroft Holmes22-Jul-08 16:11 
QuestionNot able to call dll through PL /SQL Pin
Neeraj Sinha21-Jul-08 23:23
Neeraj Sinha21-Jul-08 23:23 
AnswerRe: Not able to call dll through PL /SQL Pin
Mike Dimmick22-Jul-08 3:44
Mike Dimmick22-Jul-08 3:44 
AnswerRe: Not able to call dll through PL /SQL Pin
Wendelius22-Jul-08 6:15
mentorWendelius22-Jul-08 6:15 
Questionquerying all items... the best method? [modified] Pin
gethomast21-Jul-08 22:56
gethomast21-Jul-08 22:56 
AnswerRe: querying all items... the best method? Pin
Mycroft Holmes22-Jul-08 0:01
professionalMycroft Holmes22-Jul-08 0:01 
GeneralRe: querying all items... the best method? [modified] Pin
gethomast22-Jul-08 0:42
gethomast22-Jul-08 0:42 
AnswerRe: querying all items... the best method? Pin
leoinfo22-Jul-08 2:48
leoinfo22-Jul-08 2:48 
( You are using SQL2005, right? Smile | :) )

Try this:

;WITH RecipientsByMail (MailId, RecipientList) AS (
    select mx.Id AS MailId , 
        (   select AddressTable.Name+','
            from MailTable
            join RecipientTable on RecipientTable.MailTableId = MailTable.Id
            join AddressTable   on AddressTable.Id = RecipientTable.AddressTableId
            WHERE MailTable.Id = mx.Id
            FOR XML PATH('')
        ) AS RecipientList 
    from MailTable as mx
)
select m.Id, m.Created, m.Subject, sender.Name, r.RecipientList
from MailTable as m
join SenderTable as s on s.MailTableId = m.Id
join AddressTable as sender on sender.Id = s.AddressTableId
join RecipientsByMail as r on r.MailId = m.Id ;


Please... SAVE my time by rating the posts that you read!

There are 10 kinds of people in the world: those who understand binary and those who don't.

GeneralRe: querying all items... the best method? Pin
Mycroft Holmes22-Jul-08 3:54
professionalMycroft Holmes22-Jul-08 3:54 
GeneralRe: querying all items... the best method? Pin
leoinfo22-Jul-08 8:54
leoinfo22-Jul-08 8:54 
GeneralRe: querying all items... the best method? Pin
Mycroft Holmes22-Jul-08 14:45
professionalMycroft Holmes22-Jul-08 14:45 

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.