set head off
set echo off
set feedback off
set pagesize 0
spool filelist.txt
SELECT DISTINCT SUBSTR(FILENAME,0,30),quality_factor,psui_rbk,events FROM DAQ.RUN r, CRYO.MAGNET_HISTORY c, HANAL.DET_RUN d WHERE
  r.events>=1000 and d.quality_factor>=0 and d.run_id = r.run_id and
	r.exp_id='SEP05' and substr(r.filename,0,2) like 'be' and
	c.time(+) between r.run_start and nvl(r.run_stop,r.run_start)+0.007 and c.psui_rbk >=3100;
spool off

