#Canned queries
#Thu Apr 02 07:47:40 PDT 2010
sdqaMetricQuery1 = select * from sdqa_metrics
sdqaQuery1=select sum(metricvalue) from sdqa_ratings a, procimages b where a.pid=b.pid and sdqa_metricid=11 and nid=391 and ppid=5 and pbest>0 and vbest>0 and status>0
sdqaQuery2=select metricValue, metricErr from sdqa_ratings a, procimages b where a.pid=b.pid and nid=391 and ppid=5 and pbest>0 and vbest>0 and status>0 and sdqa_metricid=11
sdqaQuery3=select a.nid, a.obsmjd, b.pid, c.metricvalue as gMean, d.metricvalue as gStdDev from exposures a, procimages b, sdqa_ratings c, sdqa_ratings d where a.expid=b.expid and b.pid=c.pid and b.pid=d.pid and c.sdqa_metricid = 13 and d.sdqa_metricid= 21 and ppid=5 and pbest>0 and vbest > 0 and b.status > 0 and a.nid=391
sdqaQuery4=select a.nid, a.obsmjd, b.pid, c.metricvalue as gMedian, d.metricvalue as gMAbsDev from exposures a, procimages b, sdqa_ratings c, sdqa_ratings d where a.expid=b.expid and b.pid=c.pid and b.pid=d.pid and c.sdqa_metricid = 14 and d.sdqa_metricid= 22 and ppid=5 and pbest>0 and vbest > 0 and b.status > 0 and a.nid=391
sdqaQuery5=select a.nid, b.pid, b.metricvalue as gmean, c.metricvalue as gmedian, d.metricvalue as gmode, e.metricvalue as gminval, f.metricvalue as gmaxval from procimages a, sdqa_ratings b, sdqa_ratings c, sdqa_ratings d, sdqa_ratings e, sdqa_ratings f where a.pid=b.pid and a.pid=c.pid and a.pid=d.pid and a.pid=e.pid and a.pid=f.pid and b.sdqa_metricid = 13 and c.sdqa_metricid= 14 and d.sdqa_metricid= 19 and e.sdqa_metricid= 25 and f.sdqa_metricid= 26 and ppid=5 and pbest>0 and vbest > 0 and status > 0 and nid=391
sdqaQuery6=select obsmjd, metricValue, metricErr from sdqa_ratings a, procimages b, exposures c where a.pid=b.pid and b.expid=c.expid and b.nid=391 and ppid=5 and pbest>0 and vbest>0 and b.status>0 and sdqa_metricid=48 and ccdid=0
sdqaQuery7=select b.expid, metricvalue as gMedian from sdqa_ratings a, procimages b, exposures c where a.pid=b.pid and b.expid=c.expid and sdqa_metricid=14 and b.nid=1662 and ppid=5 and pbest>0 and vbest>0 and b.status>0 order by obsdate
