Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Complicated SQL question
Good morning,
We have recently started archiving all of our mail headers in Oracle,
while keeping our mail files on the local drive. Our table structure
for our archiving is as follows:
EMAIL_DIRECTION
MESSAGE_DIRECTION NOT NULL NUMBER(1) DESCRIPTION NOT NULL VARCHAR2(4)
1 From
2 To
3 Cc
4 Bcc
EMAIL_ID_X_ADDRESS
EMAIL_ID NOT NULL NUMBER(10) ADDRESS NOT NULL VARCHAR2(64) MESSAGE_DIRECTION MESSAGE_NO NOT NULL NUMBER(8) DIRECTION NOT NULL NUMBER(1) EMAIL_ID NOT NULL NUMBER(10) MESSAGE_HEADER MESSAGE_NO NOT NULL NUMBER(8) SUBJECT VARCHAR2(120) MESSAGE_DATE NOT NULL DATE TYPE NUMBER(1)
We've done a job of normalizing our tables, but now I'm having trouble making a proper query for this data.
I am attempting to determine which message_no's have the highest number of recipients, and print out the sender, subject line, date and other statistics for that message. The problem is, the only way I have been able to do this is with three or four queries, excel, and a lot of cutting and pasting.
Can anyone come up with a single query to determine this data?
Thanks for all your help. Received on Thu Oct 06 2005 - 10:01:03 CDT
![]() |
![]() |