get the error on some

Hello

the following query gives an error: Missing right parenthesis

Select Count (*)
of mru_rat_yc_tv m
where exists (select distinct (m.rating_id)
mrm_instrument M1, mrm_index I have
where m1.index_id = i.index_id
and m1.upload_date < =.
(select m2.fdate
of mrc_frequency_dates m2
where m2.fdate < = to_date('30-jun-2011')
order of m2.fdate)
and i.index_type_id = 1
and m.rating_id = m1.rating_id)

What changes should be made to the query?

Hello

Try this

 SELECT COUNT (*)
  FROM mru_rat_yc_tv m
 WHERE EXISTS (
          SELECT DISTINCT (m.rating_id)
                     FROM mrm_instrument m1, mrm_index i
                    WHERE m1.index_id = i.index_id
                      AND m1.upload_date <=
                             (SELECT   m2.fdate
                                  FROM mrc_frequency_dates m2
                                 WHERE m2.fdate <= TO_DATE ('30-jun-2011')
                              ORDER BY m2.fdate)
                      AND i.index_type_id = 1
                      AND m.rating_id = m1.rating_id)

Thank you
Prakash P

Tags: Database

Similar Questions

Maybe you are looking for