- Timestamp:
- Jul 16, 2008, 9:25:45 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/stacktool_definebyquery_insert_random.sql
r18574 r18577 1 -- Use a random set of warps for the inputs to a defined stack 1 2 INSERT INTO 2 3 stackInputSkyfile(stack_id, warp_id) 3 4 SELECT 4 @STACK_ID@, 5 @STACK_ID@, -- This should be replaced with the stack_id 5 6 warp_id 6 7 FROM ( 7 SELECT 8 warpSkyfile.*, 9 rand() AS rnd_num 10 FROM warpSkyfile 11 JOIN warpRun 12 USING(warp_id, tess_id) 13 JOIN fakeRun 14 USING(fake_id, tess_id) 15 JOIN camRun 16 USING(cam_id, tess_id) 17 JOIN chipRun 18 USING(chip_id, tess_id) 19 JOIN rawExp 20 USING(exp_id, tess_id) 21 WHERE 22 skycell_id = '%s' 23 AND tess_id = '%s' 24 AND rawExp.filter = '%s' 25 AND warpSkyfile.fault = 0 26 ORDER BY rnd_num 27 LIMIT %d 8 -- Sub-select to get the random set of warps 9 SELECT 10 warpSkyfile.*, 11 rand() AS rnd_num 12 FROM warpSkyfile 13 JOIN warpRun 14 USING(warp_id, tess_id) 15 JOIN fakeRun 16 USING(fake_id, tess_id) 17 JOIN camRun 18 USING(cam_id, tess_id) 19 JOIN chipRun 20 USING(chip_id, tess_id) 21 JOIN rawExp 22 USING(exp_id, tess_id) 23 WHERE 24 skycell_id = '%s' 25 AND tess_id = '%s' 26 AND rawExp.filter = '%s' 27 AND warpSkyfile.fault = 0 28 -- Sort by the random number, and take the first N 29 -- to get a random set of N. 30 ORDER BY rnd_num 31 LIMIT %d 28 32 ) AS randomWarps
Note:
See TracChangeset
for help on using the changeset viewer.
