-- Moving objects consistent with an asteroid.
-- Also a simple query, but we introduce the 'as' syntax, which allows us to
-- name derived quantities in the result file.
--
-- NOTE: Since asteroids are rare objects in the SDSS data, this query will
--       take a long time to run without the "TOP 10" and should be executed
--       in batch mode (with the Submit button). 

SELECT TOP 10
  objID, 
  sqrt( power(rowv,2) + power(colv, 2) ) as velocity
FROM PhotoObj 
WHERE 
  (power(rowv,2) + power(colv, 2)) between 50 and 1000
