-- 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.

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