SELECT COUNT(*) as N, MIN(fZenithDistanceMean) as minzd, MAX(fZenitHDistanceMean) as maxzd, MIN(fCurrentsMedMean) as mincur, MAX(fCurrentsMedMean) as maxcur, fSourceName AS S FROM RunInfo LEFT JOIN Source USING(fSourceKEY) WHERE NOT ISNULL(fZenithDistanceMean) AND NOT ISNULL(fCurrentsMedMean) AND fRunTypeKey=1
SELECT FLOOR(0*(fZenithDistanceMean-)/(-)) AS I, COUNT(*) AS N FROM RunInfo WHERE NOT ISNULL(fZenithDistanceMean) AND NOT ISNULL(fCurrentsMedMean) AND fRunTypeKey=1 GROUP BY I ORDER BY I
SELECT FLOOR(0*(fCurrentsMedMean-)/(-)) AS I, COUNT(*) AS N FROM RunInfo WHERE NOT ISNULL(fZenithDistanceMean) AND NOT ISNULL(fCurrentsMedMean) AND fRunTypeKey=1 GROUP BY I ORDER BY I