Average Population

  • + 1 comment

    This all makes sense and I really appreciate you spending the time to reply. Unfortunately, when I wrote the post I did not specify that I was actually using "MS SQL Server" as the language/parser. According to the MSDN documentation for Microsoft Transact-SQL, AS is perfectly valid in a FROM clause to alias a table or view. This is a snippet from their documentation which holds true back to SQL Server 2005:

    [ FROM { <table_source> } [ ,...n ] ] 
    <table_source> ::= 
    {
        table_or_view_name [ [ AS ] table_alias ]
        ...
    

    I should have been more clear when I commented about this and I apologize. I tested the submission again using the AS keyword and it now works; it would seem that this issue has been resolved since the time I posted. I had submitted a bug to HackerRank so I suppose they finally got to it.