How to add subquery in views to remove particular type of rows?
You should use where() to match table columns instead of condition

if ($view-&gt;name == "my_view") {
    $sub_query = db_select('node', 'n')
      -&gt;fields('n', array('created'))
      -&gt;where("n.created = node_revision_users.timestamp");

      $view-&gt;query-&gt;where[1]['conditions'][] = array(
        'field' =&gt; 'node_revision_users.timestamp',
        'value' =&gt; $sub_query,
        'operator' =&gt; 'NOT IN'
      );
}


Update  

Why where() not condition()

Syntax for condition:

$query-&gt;condition($field, $value = NULL, $operator = '=')


shows condition() is for building standard condition fragement

Syntax for where:

$query-&gt;where($snippet, $args = array())


shows where() is for building any arbitrary SQL as conditional fragment.

$snippet may contain any legal SQL fragment.