title: Ordering by a field not in the select statement in SQL
body: <p>I need to create a query that pulls only the customer_no column (because the software restrictions are as such, and I can't code it externally). But I need to be able to sort the data by create_dt (in reverse) column. The code/SQL is restricting me in using the following because in order to sort by something that data has to appear int the select statement.</p>
  
  <p>I can't have it appear there &ndash; is there any way around this?</p>
  
  <pre><code> Select Distinct top 3500 a.customer_no 
    From T_CUSTOMER a  WITH (NOLOCK)
    JOIN (Select a1.customer_no From VXS_CUST_TKW a1 WITH (NOLOCK) Where a1.tkw in (141)) as e ON      e.customer_no = a.customer_no
    Where 1 = 1
   order by a.create_dt desc
  </code></pre>