-- Galaxies by surface brightness
-- Find all galaxies with (blue) surface brightness between and 30 and 40, and
-- -10 < super galactic latitude (bsg) <10, and declination less than 0.5

SELECT top 100 o.bsg, o.ra, o.dec, m.sbR15
FROM Galaxy o				-- Use Galaxy view
  JOIN StackModelFits m ON m.objId = o.objId
WHERE 
   (o.bsg BETWEEN -10 AND 10)		-- SG lat between -10 and 10
   AND o.dec < 0.5			-- declination < 0.5
   AND m.sbR15 BETWEEN 30 AND 40	-- SB inside R15 bet. 30 and 40

