title: Explain syntax: select @au_id = au_id from #mytemp (Equals sign in SELECT clause)
body: <p>I come across similar queries that use <code>=</code> sign in the <code>select</code> statement every now but I always seem to skip over them because I don't really understand their logic. I would like a deeper explanation on the syntax. Also, I would like to know if you would use such a query only you have a variable involved? Is this a short form of </p>
  
  <p><code>SELECT * FROM #mytemp where @au_id = au_id</code>?</p>
  
  <p>I guess my confusion stems from seeing an equals size in the <code>select</code> instead of <code>where</code> and I haven't come across any tutorials which show this syntax. </p>
  
  <p>Here is the entire query example from <a href="https://support.microsoft.com/en-us/kb/111401" rel="nofollow">Microsoft</a>. I understand what the query is doing but I would like to understand that one line better.</p>
  
  <pre><code>/********** example 1 **********/ 
  
  declare @au_id char( 11 )
  
  set rowcount 0
  select * into #mytemp from authors
  
  set rowcount 1
  
  select @au_id = au_id from #mytemp
  
  while @@rowcount &lt;&gt; 0
  begin
      set rowcount 0
      select * from #mytemp where au_id = @au_id
      delete #mytemp where au_id = @au_id
  
      set rowcount 1
      select @au_id = au_id from #mytemp&lt;BR/&gt;
  end
  set rowcount 0
  </code></pre>