Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Miscellaneous > Re: query
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 18 Topic 6879 of 7079
Post > Topic >>

Re: query

by "amerar@[EMAIL PROTECTED] " <amerar@[EMAIL PROTECTED] > May 8, 2008 at 07:40 AM

On May 8, 8:21 am, gazzag <gar...@[EMAIL PROTECTED]
> wrote:
> On 8 May, 13:33, "ame...@[EMAIL PROTECTED]
" <ame...@[EMAIL PROTECTED]
> wrote:
>
> > I do not understand why the CREATE table will help here.  The three
> > columns of interest are above.  If you see the CREATE statement, how
> > does that help with the query?  Those are the only three columns which
> > are related here......
>
> > Any why the INSERT also?
>
> > John- Hide quoted text -
>
> > - Show quoted text -
>
> The scripts would help me to help recreate your problem and allow me
> to test my query.  That way, we can be sure that we're singing from
> the same hymn sheet, as it were.
>
> However, if you can't be bothered to do that, I can't be bothered to
> spend any time on it myself, either.
>
> I'm out.
>
> -g

Understood.  In the example below, I would want to ignore customer
35666699 because he falls out of the date range, 01/01/2005 -
12/31/2005.  I'd ignore customer 21435557 because his status is D.  I
would include customer 32547687 because his MAX date has a status of
A.  Likewise, I'd want customer 35666687 since his MAX date has a
status of A.  I would not want customer 22222222 because his MAX date
has a status o D.

Hopefully I got it right.......


CREATE TABLE EMAIL_PRODUCT_HIST (
  ACTION_TYPE       VARCHAR2(2),
  STATUS            VARCHAR2(2),
  ACTION_DATE       DATE,
  EMAIL_HIST_ID     NUMBER CONSTRAINT EMAIL_PRODUCT_HIST_HIST_ID_NN
NOT NULL,
  CUSTOMER_ID       NUMBER CONSTRAINT EMAIL_PRODUCT_HIST_CUST_ID_NN
NOT NULL,
  EMAIL_PRODUCT_ID  VARCHAR2(5));

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','A',TO_DATE('09032005','MMDDYYYY'),32547687,'PPM');

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','D',TO_DATE('08092005','MMDDYYYY'),32547687,'PPM');

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','A',TO_DATE('03042005','MMDDYYYY'),32547687,'PPM');

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','D',TO_DATE('03042005','MMDDYYYY'),21435557,'PPM');

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','A',TO_DATE('10092005','MMDDYYYY'),35666687,'PPM');

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','A',TO_DATE('12092005','MMDDYYYY'),35666687,'PPM');

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','D',TO_DATE('12152005','MMDDYYYY'),68888687,'PPM');

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','A',TO_DATE('12202006','MMDDYYYY'),35666699,'PPM');

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','A',TO_DATE('03152005','MMDDYYYY'),22222222,'PPM');

INSERT INTO EMAIL_PRODUCT_HIST
VALUES ('H','D',TO_DATE('05202005','MMDDYYYY'),222222222,'PPM');
 




 18 Posts in Topic:
query
"amerar@[EMAIL PROTE  2008-05-06 13:54:19 
Re: query
Mark D Powell <Mark.Po  2008-05-07 09:44:54 
Re: query
"amerar@[EMAIL PROTE  2008-05-07 10:50:02 
Re: query
Urs Metzger <urs@[EMAI  2008-05-08 20:45:15 
Re: query
gazzag <gareth@[EMAIL   2008-05-08 04:32:06 
Re: query
"amerar@[EMAIL PROTE  2008-05-08 05:33:56 
Re: query
Ed Prochak <edprochak@  2008-05-08 06:00:03 
Re: query
gazzag <gareth@[EMAIL   2008-05-08 06:21:13 
Re: query
"amerar@[EMAIL PROTE  2008-05-08 07:40:19 
Re: query
gazzag <gareth@[EMAIL   2008-05-08 08:06:11 
Re: query
"amerar@[EMAIL PROTE  2008-05-08 09:37:01 
Re: query
"amerar@[EMAIL PROTE  2008-05-08 11:55:55 
Re: query
Urs Metzger <urs@[EMAI  2008-05-08 21:40:25 
Re: query
Ed Prochak <edprochak@  2008-05-09 05:40:13 
Re: query
"amerar@[EMAIL PROTE  2008-05-12 05:56:52 
Re: query
"amerar@[EMAIL PROTE  2008-05-12 05:59:18 
Re: query
Urs Metzger <urs@[EMAI  2008-05-12 16:57:59 
Re: query
"amerar@[EMAIL PROTE  2008-05-12 06:30:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Aug 21 17:58:22 CDT 2008.