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
i am looking at this site:
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:
- is this mysql or mssql?
- what does this do?
set nocount off
- why is this in brackets?
[User Link]
- what does this do?
CONVERT(int, @endDate - CreationDate) as Days
thanks!
© Stack Overflow or respective owner