IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 11, 2026, 3:09:36 PM (2 months ago)
Author:
eugene
Message:

fix various SQL errors caught by more strict mysql versions, especially: force SQL to select a specific entry from non-aggregated fields when other fields are aggregated using e.g., GROUP BY

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-pstamp-20260421/ippTools/share/difftool_definewarpstack_old.sql

    r40109 r43014  
    11-- Get list of warp-stack pairs that can be diffed
    22-- and check results against existing diffs
     3-- EAM: the output of this query should be limited to
     4-- only the fields need otherwise we have aggregation errors
    35SELECT
    4    exp_id,
    5    warp_id,
    6    rawExp.filter,
    7    warpRun.label AS warpLabel,
    8    warpRun.data_group AS warpDataGroup,
    9    warpRun.tess_id,
    10    warpSkyfile.skycell_id,
    11    MAX(stack_id) AS stack_id,
    12    stackRun.label AS stackLabel,
    13    stackRun.data_group AS stackDataGroup,
    14    diff_id,
    15    diffRun.label AS diffLabel
     6  exp_id,
     7  warp_id,
     8--   rawExp.filter,
     9--   warpRun.label AS warpLabel,
     10  warpRun.data_group AS warpDataGroup,
     11  warpRun.tess_id,
     12  warpSkyfile.skycell_id,
     13  MAX(stack_id) AS stack_id
     14-- these are NOT needed as an output
     15--   MIN(stackRun.label) AS stackLabel,
     16--   MIN(stackRun.data_group) AS stackDataGroup,
     17--   diffRun.diff_id,
     18--   diffRun.label AS diffLabel
    1619FROM warpRun
    1720     JOIN fakeRun USING(fake_id)
     
    4144-- %s
    4245GROUP BY exp_id,warp_id,skycell_id
     46
     47-- the GROUP BY above, combined with the MAX(stack_id) selects the most recent stack_id
     48-- for a given exposure->warp->stack
Note: See TracChangeset for help on using the changeset viewer.