title: MySQL local variables
body: <p>I am trying to define and initialize a MySQL variable for a query.</p>
  
  <p>I have the following:</p>
  
  <pre><code>declare @countTotal int;
  SET @countTotal = select COUNT(*)
   from nGrams;
  </code></pre>
  
  <p>I am using MySQL in Netbeans and it tells me I have an error. What/where is my error?</p>
  
  <p>How can I fix this?</p>