title: Comparing if two columns are equal in Where clauses
body: <p>I would like to compare if two columns are equal in the where clause. The columns are two columns are from different tables that have been joined</p>
  
  <p>This is the statement that I am using</p>
  
  <pre><code>SELECT authors.state, sum(qty*price)as sales_revenue 
    from authors,titles, stores, sales 
   WHERE authors.state = (SELECT  stores.state from stores)
  </code></pre>
  
  <p>but I get an error that says this
  M</p>
  
  <pre><code>sg 8120, Level 16, State 1, Line 1
  Column 'authors.state' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
  </code></pre>