Does db_query support UNION? I have a query that contains a UNION operator. If I ran my query it runs perfectly straight on the database but I am getting an empty result in Drupal. 

Here is a simplified version of the query:

$result = db_query("
    SELECT *
    FROM (
    SELECT
    agent_number
    FROM table1
    WHERE agent_number IN (':agent_numbers')
    UNION
    SELECT
    agent_number
    FROM table2
    WHERE agent_number IN (':agent_numbers')) t", array(
      ':agent_numbers' =&gt; $agent_ids,
    )
  )-&gt;fetchAll();


Is it that db_query() doesn't support UNION?
Yes, db_query() does support UNION. I had a problem with my query:

WHERE agent_number IN (':agent_numbers')


Should be:

WHERE agent_number IN (:agent_numbers)