title: Sql Server, how can I identify a result column so I can use it in a where clause
body: <p>Here is the problem.</p>
  
  <pre><code>select count(studentID) AS count from educators where count  &gt; 1 group by studentid  
  </code></pre>
  
  <p>Will not work as SQL Server does not yet know about the count column. </p>
  
  <p>So I have to do this </p>
  
  <pre><code>select *
    from (select count(StudentID) as count
            from educators
           group by studentid
         ) s
   where s.count &gt; 1
  </code></pre>
  
  <p>Is there a more elegant solution?  It seems like there should be a much nicer way to do this. </p>