Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Complicated SQL question

Re: Complicated SQL question

From: <neurotoxin2309_at_yahoo.com>
Date: 6 Oct 2005 11:29:01 -0700
Message-ID: <1128623341.467374.60060@o13g2000cwo.googlegroups.com>


I'll really demonstrate my ignorance by posting this, however I did a select distinct on message_no to find out which messages we had records for. Then I used a macro to generate quite a few of these:

select '1', count(message_no) from message_direction where direction <> 1
and message_no = 1;

Then I used Excel so I only had the message number and count result, then I went back to a macro and generated a bunch of these:

select b.message_no, a.address, c.subject, c.message_date, 72 as recipients
from email_id_x_address a, message_direction b, message_header c where b.message_no = c.message_no

and b.direction = 1
and a.email_id = b.email_id
and b.message_no = 1785;

The 72 was derived from the previous query, because I didn't know how to get it all in a single field.

As you can see I'm over my head with complicated queries, I generally just do selects. I'd really like to learn how to do this properly though, and thought this would be a good opportunity. Received on Thu Oct 06 2005 - 13:29:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US