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 > Messed Up Query
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 6863 of 6989
Post > Topic >>

Messed Up Query

by Mtek <mtek@[EMAIL PROTECTED] > Apr 28, 2008 at 10:51 AM

Hi,

I have this query:

SELECT q10.q10_count,
vi.mgr_flag,vi.inst_type,vi.inst_num,vi.inst_cst,vi.inst_zip,vi.inst_phone,vi.url,vi.turnover,vi.hold_cnt,
vi.date_,vi.inst_size,vi.inst_dchg,
 
vh.ticker,vh.q0_shares,vh.q1_shares,vh.q0q1_grwth,vh.q0q1_dchg,vh.shares_out,
mt.comp_name, sd.sector_name, p.closing
FROM vinst vi, vhold vh, master_table mt, stock_data sd, prices p,
     (SELECT count(*) q10_count FROM vhold vh
      WHERE q1_shares = 0 GROUP BY vh.ticker) q10
WHERE inst_name = 'Yacktman Fund'
  AND vi.inst_num = vh.inst_num
  AND vh.ticker = mt.ticker
  AND mt.m_ticker = sd.m_ticker
  AND mt.m_ticker = p.m_ticker;

Take a look at the inner query in the FROM clause:
     (SELECT count(*) q10_count FROM vhold vh
      WHERE q1_shares = 0 GROUP BY vh.ticker) q10

I basically need the same criteria applied as the outer query.  Do I
have to re-list the criteria?  I'll have to do that count for 5
fields.  It will make this query WAY long.......

Thanks!

John
 




 6 Posts in Topic:
Messed Up Query
Mtek <mtek@[EMAIL PROT  2008-04-28 10:51:20 
Re: Messed Up Query
Peter Nilsson <airia@[  2008-04-28 16:17:54 
Re: Messed Up Query
Robert Klemme <shortcu  2008-04-29 02:18:21 
Re: Messed Up Query
Mtek <mtek@[EMAIL PROT  2008-04-29 05:20:06 
Re: Messed Up Query
Mtek <mtek@[EMAIL PROT  2008-04-29 05:51:16 
Re: Messed Up Query
Robert Klemme <shortcu  2008-04-30 23:42:43 

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 4:32:52 CDT 2008.