title: SQL Nested Query Calculation
body: <pre><code>    SELECT *, 
             (select SUM(sl.priceeach*sl.qty) as 'tot' 
                    from salesline sl where sl.soid=so.soid) as 'total',
             so.total,
             so.discount,
             so.tax
      from salesorder so
  </code></pre>
  
  <p>I am trying to figure out this query but I couldn't display the total in another coloumn 
  to display the tax included and discount minused data </p>
  
  <pre><code>ERROR : #1054 - Unknown column 'so.total' in 'field list' 
  </code></pre>
  
  <p>whats wrong with my query ?</p>