Subquery

From: ExecMan <artmerar_at_yahoo.com>
Date: Thu, 20 Oct 2011 08:17:15 -0700 (PDT)
Message-ID: <2ecd55f0-24ed-46e9-8eb9-1b26012886e5_at_r1g2000yqm.googlegroups.com>



Hi,

I've had just about enough of this. Simple ass query and 3 hours and I cannot figure it out. This will be part of a much large query, but here is the basic query and Oracle does not like it. What is wrong?

SELECT ticker, closing_price
FROM (SELECT h.ticker, h.closing_price

           FROM price_history_mv h
           WHERE s.m_ticker = h.m_ticker
              AND TO_DATE(h.price_date,'YYYYMMDD') =
TRUNC(next_day(sysdate-7,'FRIDAY')))
FROM stock_info_snapshot s
WHERE s.z_rank = 1;

>> SQL command not properly ended

Thanks. Received on Thu Oct 20 2011 - 10:17:15 CDT

Original text of this message