-- Galaxies meeting two simple criteria. 
-- Find all galaxies brighter than r magnitude 22, where the local
-- extinction is > 0.175.  This is a simple query that uses a WHERE clause,
-- but now two conditions that must be met simultaneously.

SELECT TOP 10 objID 
FROM Galaxy 
WHERE 
  r < 22			-- r IS NOT deredenned
  and extinction_r > 0.175	-- extinction more than 0.175
