title: More efficient way to write this T-SQL query? Pass column from EXISTS statement?
body: <p>Is there a better way to write this? Primarily I'm referring to the <code>THEN</code> statement where I basically repeat the <code>CASE WHEN EXISTS</code> statement. It would be great to <code>SELECT DateJoined</code> inside the <code>EXISTS</code> statement and then use it outside that statement in the <code>THEN</code>. Is that possible?</p>
  
  <pre><code>SELECT
      Email,
      CASE 
         WHEN EXISTS (SELECT 1
                      FROM _Subscribers
                      WHERE EmailAddress = Email)
            THEN (SELECT DateJoined 
                  FROM _Subscribers 
                  WHERE EmailAddress = Email)
            ELSE LastModifiedDate
      END as CreatedDate
  FROM 
      [Optin Monster]
  </code></pre>