title: Invalid column name in SQL Server
body: <p>I'm trying to add where condition to my select statement but I'm getting invalid column name exception.</p>
  
  <pre><code>SELECT "Ugly OLAP name" as "Value" 
  FROM OpenQuery( OLAP, 'OLAP Query')
  </code></pre>
  
  <p>But if I try to add:</p>
  
  <pre><code>WHERE "Value" &gt; 0
  </code></pre>
  
  <p>you suggested that I have to use the original name and it works fine.</p>
  
  <p>But what if I can't use the original column name as follow</p>
  
  <pre><code>SELECT 
      ROW_NUMBER() OVER(PARTITION BY P.ProviderID 
                        ORDER BY T.PostedUTC DESC, T.TransactionID DESC) as RN 
  FROM
     Provider p 
  INNER JOIN 
     Transaction T 
  WHERE 
     RN = 1
  </code></pre>
  
  <p>How can I access RN at my where ???</p>