
example of joining ipptopsps and gpc1 tables:

mysql -h ipp006 -u dvo -p ipptopsps -e "select batch_id, stage_id from batch where batch_type = 'P2'" > P2.batches.dat

on ippdb01: cp P2.batches.dat /tmp/datadump/

mysql -h ippdb01 -u dvo -p gpc1
mysql> create temporary table eam_p2_batches (batch_id int, cam_id int);
mysql> create temporary table eam_st_batches (batch_id int, stack_id int);
mysql> load data infile '/tmp/datadump/P2.batches.dat' into table eam_p2_batches ignore 1 lines (batch_id, cam_id);
mysql> select degrees(ra) as ra_deg, degrees(decl) as dec_deg, camRun.cam_id, batch_id, chip_id, exp_id, exp_name from camRun join chipRun using (chip_id) join rawExp using (exp_id) join eam_p2_batches on (eam_p2_batches.cam_id = camRun.cam_id) where batch_id is not null and degrees(ra) > 298.0 limit 100;
