wiki:db/queries/044
Last modified 6 years ago Last modified on 02/01/2013 12:19:58 AM

Find variable stars close to hot stars

SELECT v.objectId, v.ra, v.decl, 
       s.objectId, s.ra, s.decl
FROM   Object v, Object s
WHERE  v.variability > 0.8    -- is a variable object
   AND s.extendedParam < 0.2  -- is a star
   AND v.objectId <> s.objectId
   AND spDist(v.ra, v.decl, s.ra, s.decl) < :distance
   AND (s.gMag-s.rMag < 0.0 OR 
        s.rMag-s.iMag < 0.0 OR
        s.uMag-s.gMag < 1.0)