getting node items by taxonomy I can get a list of node items by content type, using the following query:

$query = db_select('node', 'n');
    $query-&gt;condition('n.status', NODE_PUBLISHED);
    $query-&gt;condition('n.type', 'slider');
    $nids = $query
        -&gt;fields('n', array('nid'))
        -&gt;orderBy('changed', 'DESC')
        -&gt;range(0, 4)
        -&gt;addTag('node_access')
        -&gt;execute()
        -&gt;fetchCol();
    $nodes = node_load_multiple($nids);


I want to filter this output further with taxonomy. How can I do this?
You need to use the EntityFieldQuery instead of the SelectQuery that db_select uses. You should do something like this:

$query = new EntityFieldQuery();
$result = $query
  -&gt;entityCondition('entity_type', 'node', '=')
  -&gt;entityCondition('bundle', 'slider', '=')
  -&gt;fieldCondition('fieldname', 'tid', $tid)
  -&gt;propertyOrderBy('changed', 'DESC')
  -&gt;range(0, 4)
  -&gt;addTag('node_access')
  -&gt;execute();


The results will be an array of objects containing the nid and vid.

Read more about the fieldCondition