-- Using spatial unit vectors for coordinate cuts.
-- Find galaxies in a given area of the sky, using a coordinate cut
-- in the unit vector cx,cy,cz that corresponds to a specific RA range.
-- Another simple query that uses math in the WHERE clause.
--
-- Finds 100 galaxies in 230 sec on DR2, but this is a very slow way to do
-- coordinate cuts.  Using RA/dec is *much* faster due to indexing.
--
--This Sample Query will not work for SDSS3 DR8 contexts

SELECT TOP 100 colc_g, colc_r
FROM  Galaxy
WHERE 
	(-0.466 * cx + 0.689 * cy>=0)
	and (-0.385 * cx - 0.173 * cy <0)
