Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem with simple SQL query part 2

Re: Problem with simple SQL query part 2

From: Angelo Cavallaro <angelo.cavallaro_at_pcm.bosch.de>
Date: 1998/10/01
Message-ID: <361391A3.39A@pcm.bosch.de>#1/1

Hi Terry,

this could be slow, but it should do the work.

insert into t_sedol (sedol, market_cap)
select sedol, market_cap
from t_master_download a
where country = 'United Kingdom'
  and downloaddate = '01-DEC-92'
  and 246 >= (select count(*)

		from t_master_download b
	       where b.country = a.country
		 and b.downloaddate = a.downloaddate
		 and b.market_cap >= a.market_cap);

Be careful comparing dates. If your downloaddate has a time other then midnight (00:00:00) the comparasion fails. In this case use the TRUNC command to cut off the time from the date.

HTH
Angelo. Received on Thu Oct 01 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US