title: Use variable names in select clause, need them to act like column name - SQL Server
body: <p>I have a table:</p>
  
  <pre><code>T (Mon varchar(3));
  
  INSERT INTO T VALUES ('Y');
  </code></pre>
  
  <p>Case 1:   </p>
  
  <pre><code>DECLARE @day varchar(3) = 'Mon'
  
  SELECT Mon 
  FROM T;  --result : Y (no problem)
  </code></pre>
  
  <p>Case 2:   </p>
  
  <pre><code>DECLARE @day VARCHAR(3) = 'Mon'
  
  SELECT @day 
  FROM T; --result : Mon
  </code></pre>
  
  <p>If I want to get result <code>Y</code> in second case, how can I do that without re-designing the solution completely.</p>