SELECT "raw" AS stage_name,count(exp_id), state FROM rawExp GROUP BY state
UNION
SELECT "chip" AS stage_name,count(chip_id),state FROM chipRun WHERE label NOT IN ('LAP.PV3W.20150312','LAP.PV3.20140730','LAP.PV3.20140730.remote') GROUP BY state
UNION
SELECT "chip_lies" AS stage_name,count(chip_id),state FROM chipRun  WHERE label IN ('LAP.PV3W.20150312','LAP.PV3.20140730','LAP.PV3.20140730.remote') GROUP BY state
UNION
SELECT "cam" AS stage_name,count(cam_id), state FROM camRun GROUP BY state
UNION
SELECT "warp" AS stage_name,count(warp_id), state FROM warpRun WHERE label NOT IN ('LAP.PV3W.20150312','LAP.PV3.20140730','LAP.PV3.20140730.remote','LAP.PV3.20140730.final','LAP.PV3.20140730') GROUP BY state
UNION
SELECT "warp_lies" AS stage_name,count(warp_id),state FROM warpRun  WHERE label IN ('LAP.PV3W.20150312','LAP.PV3.20140730','LAP.PV3.20140730.remote','LAP.PV3.20140730.final','LAP.PV3.20140730') GROUP BY state
UNION
SELECT "diff" AS stage_name,count(diff_id), state FROM diffRun WHERE label NOT IN ('LAP.PV3W.20150312','LAP.PV3.20140730.diff01.done','LAP.PV3.20140730.remote') GROUP BY state 
UNION
SELECT "diff_lies" AS stage_name,count(diff_id),state FROM diffRun  WHERE label IN ('LAP.PV3W.20150312','LAP.PV3.20140730.diff01.done','LAP.PV3.20140730.remote') GROUP BY state
UNION
SELECT "stack" AS stage_name,count(stack_id), state FROM stackRun GROUP BY state
UNION 
SELECT "ssky" AS stage_name, count(sky_id), state FROM staticskyRun GROUP BY state
UNION
SELECT "skycal" AS stage_name, count(skycal_id), state FROM skycalRun GROUP BY state
UNION
SELECT "ff" AS stage_name, count(ff_id), state FROM fullForceRun GROUP BY state
;