title: With an Inner Join between just two tables, having trouble filtering a "right" database column
body: <p>So say code=</p>
  <pre><code>select toy category, count(customerstate)
  from toyinventory ti
  INNER JOIN toyorders to
  ON ti.orderid = to.orderid
  where ti.plantid = 31-12-2020
  and ti.category = 'dolls'
  group by customerstate'
  </code></pre>
  <p>ok so filtering date and category which are columns in toyinventory  but how to filter something from toyorders like say to.dolltype &lt;&gt; 'barbie' ?  THX</p>
  <p>getting cannot be bound error when i tried this as another and
  getting bad data when i tried this as and after ON</p>