Beginner SQL section: avoiding repeated expression

后端 未结 5 978
-上瘾入骨i
-上瘾入骨i 2021-02-14 15:45

I\'m entirely new at SQL, but let\'s say that on the StackExchange Data Explorer, I just want to list the top 15 users by reputation, and I wrote something like this:

         


        
5条回答
  •  梦毁少年i
    2021-02-14 15:53

    You CAN refer to RepInK in the Order By clause, but in the Where clause you must repeat the expression. But, as others have said, it will only be executed once.

提交回复
热议问题