Index: /branches/sc_branches/ippMonitorLap/def/lapExposures.d
===================================================================
--- /branches/sc_branches/ippMonitorLap/def/lapExposures.d	(revision 31740)
+++ /branches/sc_branches/ippMonitorLap/def/lapExposures.d	(revision 31741)
@@ -1,5 +1,3 @@
-TABLE lapRun JOIN lapExp USING(lap_id) JOIN rawExp USING(exp_id,filter) JOIN chipRun USING(chip_id)
-#JOIN chipRun USING(lapExp.chip_id) 
-#JOIN chipRun AS pairRun USING(lapExp.pair_id)
+TABLE lapRun JOIN lapExp USING(lap_id) JOIN rawExp USING(exp_id,filter) JOIN chipRun USING(chip_id) JOIN chipRun AS pairRun WHERE pairRun.chip_id=lapExp.pair_id
 TITLE LAP Exposures
 FILE  lapExposures.php
@@ -16,6 +14,7 @@
 FIELD lapExp.exp_id,          6, %d,     Exp ID,	value, rawImfile.php, ARG1
 FIELD lapExp.chip_id,         6, %d,     Chip ID,	value, chipStageExp.php, ARG2
-FIELD chipRun.state,          6, %s,     State (chipRun)
+FIELD chipRun.state,          6, %s,     State (chip_id)
 FIELD lapExp.pair_id,         6, %d,     Pair ID,	value, chipStageExp.php, ARG3
+FIELD pairRun.state,          6, %s,     State (pair_id)
 FIELD lapRun.tess_id,         8, %s,     tess_id
 FIELD lapRun.projection_cell, 10, %s,    ProjCell
