Index: branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_find_cam_and_chip_id.sql
===================================================================
--- branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_find_cam_and_chip_id.sql	(revision 42195)
+++ branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_find_cam_and_chip_id.sql	(revision 42195)
@@ -0,0 +1,35 @@
+-- this needs to join a table of chipRuns and a table of camRuns based on exp_id
+
+SELECT * FROM
+(
+ SELECT
+     chipRun.chip_id,
+     rawExp.ra,
+     rawExp.decl
+ FROM chipRun
+ JOIN rawExp
+      USING(exp_id)
+ WHERE
+      chipRun.state = 'full'
+ -- AND exp_id = 162
+ -- AND chip_id = 140
+) AS myChip
+JOIN
+(
+SELECT
+    camRun.cam_id,
+    rawExp.ra,
+    rawExp.decl
+FROM camRun
+JOIN chipRun
+     USING(chip_id)
+JOIN rawExp
+     USING(exp_id)
+WHERE
+     camRun.state = 'full'
+-- AND exp_id = 162
+-- AND cam_id = 234
+) AS myCam
+USING(exp_id)
+
+ 
