Add reverse IN clause to db API I need to add IN clause while implementing hook_views_pre_execute

But it's not the regular IN added like the next line 


  {table1}.col1 IN (val1, val2) 


$query-&gt;condition('author', array($user-&gt;uid), 'IN');


Wanted to add reverse 


  {val} IN ({table1}.col1, {table2}.col2)


$query-&gt;condition($user-&gt;uid, array(pm_message.author, pm_index.recipient), 'IN');


But the query takes the fields as values not column names

Is it possible to be added in drupal

Simply I need to get messages where the user is the author or the reciever in privatemsg
That's (arguably) non-standard, so you'll need a where. 

For example,

$query = db_select('foo');
$query-&gt;where(':val IN ({table1}.col1, {table2}.col2)', array(':val' =&gt; $user-&gt;uid));


will get you

SELECT 
FROM 
{foo} foo
WHERE  (:val IN ({table1}.col1, {table2}.col2)) 


(with :val replaced by $user-&gt;uid).