1
EmailQueueAttachments 테이블에 일대 다 관계가있는 부모/하위 테이블이 있습니다.하위 테이블 결과 연결
부모 테이블 (EmailQueue)은 하나의 행과 자식 테이블 (EmailQueueAttachments)와 나는 아래의 결과를 얻을 수있는 간단한 가입 쿼리를 작성 후 2 개 관련 행이 있습니다.
SELECT EmailQueue.ID, EmailQueue.SenderAddress, EmailQueue.RecipientList, EmailQueue.CCList, EmailQueue.Subject, EmailQueue.Body, EmailQueue.BodyHTML,
EmailQueue.DisclaimerFooter, EmailQueue.Sent, EmailQueue.SendError, EmailQueue.CreatedDate,EmailQueueAttachments.AttachmentPath
FROM EmailQueue LEFT OUTER JOIN
EmailQueueAttachments ON EmailQueue.ID = EmailQueueAttachments.EmailQueueID
WHERE (EmailQueue.Sent = 0) AND (EmailQueue.SendError = 0) AND (EmailQueue.BodyHTML IS NULL)
4 xxxxxxx xxxxxxx xxxxxxx xxxxxxx xxxxxxx NULL xxxxxxx 0 0 10/07/2012 11:58 \\server\orange.png
4 xxxxxxx xxxxxxx xxxxxxx xxxxxxx xxxxxxx NULL xxxxxxx 0 0 10/07/2012 11:58 \\server\pear.png
를 CSV로 자식 테이블에서 AttachmentPath 열이 한 행을 반환하거나 내가 이것을 달성하기 위해 저장 프로 시저 사용 임시 테이블을 작성해야 할 수있는 간단한 방법이 있나요?
좋은 호간. 치료를해라. –