title: SQL Geography data type column in GROUP BY clause
body: <p>I'm using SQL Server and creating a script which will get the workers geographical location out of my database. The script is below.</p>
  
  <pre><code>SELECT w.display_name, w.geo_location
  FROM jobs j WITH(NOLOCK)
  INNER JOIN workers w WITH(NOLOCK) ON w.worker_id = j.worker_id
  WHERE .....
  </code></pre>
  
  <p>The problem is that I want to add <code>GROUP BY w.display_name, w.geo_location</code> to the script as there are duplicate records being shown. Added a column with the data type geography to a group by clause causes an error to be thrown. </p>
  
  <p>The error being thrown when I add this in is:</p>
  
  <blockquote>
    <p>The type "geography" is not comparable. It cannot be used in the GROUP BY clause.</p>
  </blockquote>
  
  <p>Is there a way around this? I cannot convert <code>w.geo_location</code> to a <code>VARCHAR</code> as it is needed in the geography data type. </p>