IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 22, 2026, 3:10:37 PM (3 days ago)
Author:
eugene
Message:

SELECT DISTINCT with UNION needs grouping parentheses in modern SQL

File:
1 edited

Legend:

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

    r34766 r43096  
    11-- does this result in too many entries (one for each diffInputSkyfile?)
    22-- all of this is just to get the camera used for the diff run
    3 SELECT DISTINCT * FROM
    4    (SELECT DISTINCT
     3SELECT * FROM
     4   ((SELECT DISTINCT
    55            diffRun.diff_id,
    66            rawExp.camera,
    … …  
    3131             diffRun.state = 'goto_scrubbed' OR
    3232             diffRun.state = 'goto_purged')
    33         @INNERLIMITS@
     33        @INNERLIMITS@)
    3434     UNION
    35      SELECT DISTINCT
     35     (SELECT DISTINCT
    3636            diffRun.diff_id,
    3737            rawExp.camera,
    … …  
    6262             diffRun.state = 'goto_scrubbed' OR
    6363             diffRun.state = 'goto_purged')
    64         @INNERLIMITS@
     64        @INNERLIMITS@)
    6565     UNION
    66      SELECT DISTINCT
     66     (SELECT DISTINCT
    6767            diffRun.diff_id,
    6868            rawExp.camera,
    … …  
    9393             diffRun.state = 'goto_scrubbed' OR
    9494             diffRun.state = 'goto_purged')
    95         @INNERLIMITS@
     95        @INNERLIMITS@)
    9696     UNION
    97      SELECT DISTINCT
     97     (SELECT DISTINCT
    9898            diffRun.diff_id,
    9999            rawExp.camera,
    … …  
    124124             diffRun.state = 'goto_scrubbed' OR
    125125             diffRun.state = 'goto_purged')
    126         @INNERLIMITS@
     126        @INNERLIMITS@)
    127127        ) as Foo
    128128        WHERE 1
Note: See TracChangeset for help on using the changeset viewer.