help with stored procedure

Posted by I__ on Stack Overflow See other posts from Stack Overflow or by I__
Published on 2010-06-09T18:08:56Z Indexed on 2010/06/09 18:32 UTC
Read the original article Hit count: 123

Filed under:
|

i am looking at this site:

http://cloudexchange.cloudapp.net/stackoverflow/s/84/rising-stars-top-50-users-ordered-on-rep-per-day

set nocount on

DECLARE @endDate date
SELECT @endDate = max(CreationDate) from Posts

set nocount off

SELECT TOP 50
    Id AS [User Link], Reputation, Days,
    Reputation/Days AS RepPerDays
FROM (
    SELECT *,
        CONVERT(int, @endDate - CreationDate) as Days
    FROM Users
) AS UsersAugmented
WHERE
    Reputation > 5000
ORDER BY
    RepPerDays DESC

i am also a beginner at SQL. i have the following questions about this code:

  1. is this mysql or mssql?
  2. what does this do? set nocount off
  3. why is this in brackets? [User Link]
  4. what does this do? CONVERT(int, @endDate - CreationDate) as Days

thanks!

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql