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/chiptool_completely_processed_exp.sql

    r35789 r43014  
    2020    (SELECT
    2121        chipRun.*,
    22         rawImfile.class_id as rawimfile_class_id,
    23         chipProcessedImfile.class_id,
     22--      rawImfile.class_id and chipProcessedImfile.class_id are not aggregated
     23--      and cause problems given the GROUP BY
     24--      clause below.  A solution is to explicitly select a single value, the MIN.
     25--      But this is not needed because the field is not used by the rest of the query
     26--      rawImfile.class_id as rawimfile_class_id,
     27--      chipProcessedImfile.class_id,
     28--      MIN(rawImfile.class_id) as rawimfile_class_id,
    2429        -- XXX using chipProcessedImfile assumes that all imfile's have
    2530        -- the same magicked value if that isn't right then more than one
     
    2833        -- We could use rawExp.magicked but that would make it possible for
    2934        -- the chipRun to have a different magicked value than the imfiles
    30         chipProcessedImfile.magicked AS imfile_magicked
     35        MIN(chipProcessedImfile.magicked) AS imfile_magicked
    3136    FROM chipRun
    3237    JOIN rawImfile
Note: See TracChangeset for help on using the changeset viewer.