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 Server > Right Parenthes...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 16484 of 16860
Post > Topic >>

Right Parenthesis

by Mtek <mtek@[EMAIL PROTECTED] > Apr 29, 2008 at 08:38 AM

Hi,

I have this query, it works fine:


SELECT customer_id
FROM (
 SELECT MAX(a.action_date), a.customer_id
 FROM email_product_hist a, email_product_hist b
 WHERE a.action_date = b.action_date
   AND a.customer_id NOT IN
   (SELECT c.customer_id
    FROM new_customer.customer_account c)
   AND a.customer_id IN
  (SELECT d.customer_id
   FROM email_product_hist d
   WHERE action = 'A'
     AND email_product_id = 'PPM'
     AND action_date BETWEEN TO_DATE('01012005','MMDDYYYY') AND
TO_DATE('03312005','MMDDYYYY'))
 GROUP BY a.customer_id)
 ORDER BY customer_id;

Now, they want to add email to it:


SELECT customer_id, email..........
FROM (
..
..
..
   WHERE action = 'A'
     AND email_product_id = 'PPM'
     AND action_date BETWEEN TO_DATE('01012005','MMDDYYYY') AND
TO_DATE('03312005','MMDDYYYY'))

So, I assume that I need to give this subquery a name and add the
table with the email and the join:

   WHERE action = 'A'
     AND email_product_id = 'PPM'
     AND action_date BETWEEN TO_DATE('01012005','MMDDYYYY') AND
TO_DATE('03312005','MM,DDYYYY')) a, customer_table

That gives me some "missing right parenthesis" error.........search
me.  I've tried multiple combinations.
 




 1 Posts in Topic:
Right Parenthesis
Mtek <mtek@[EMAIL PROT  2008-04-29 08:38:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan13V112 Sun Jul 6 16:44:46 CDT 2008.