title: Postgres query doesn't get data when using AND operator
body: <p>Im trying to get data from a postgres database, using the AND operator but doesnt work.
  If I exclude de AND using only <code>where items.name = 'Uptime'</code> or <code>where hstgrp.name like 'TEAM%'</code> I get the data, but when I combine them doesnt work, any ideas on how to solve this?</p>
  
  <pre><code>select history_uint.clock , history_uint.value , hstgrp.name , hosts.name 
  FROM history_uint
  join items on items.itemid = history_uint.itemid
  join hosts on hosts.hostid = items.hostid
  join hosts_groups on hosts_groups.hostid = hosts.hostid
  join hstgrp on hstgrp.groupid = hosts_groups.groupid 
  where items.name = 'Uptime'
  and hstgrp.name like 'TEAM%'
  </code></pre>