drupal 7 webform custom views query
Webform's schema makes it fairly painful, but this should fetch all of the submitted data for any submission where the field with key status has a value of 1:

$nid = 25;
$form_key = 'status';
$data = '1';

$query = db_select('webform_submitted_data','n');
$query-&gt;leftJoin('webform_component', 'wc', 'wc.cid = n.cid AND wc.nid=n.nid');
$query-&gt;innerJoin('webform_component', 'wc_filter', "wc_filter.nid=n.nid AND wc_filter.form_key=:form_key", array(':form_key' =&gt; $form_key));
$query-&gt;innerJoin('webform_submitted_data', 'n_filter', 'wc_filter.cid = n_filter.cid AND n.sid=n_filter.sid AND n_filter.data=:data', array(':data' =&gt; $data));

$query-&gt;fields('n', array('sid','data','cid'));
$query-&gt;fields('wc', array('form_key','cid'))
  -&gt;condition('n.nid', $nid);


There may be performance implications doing this if you have more than a few records...

You could simplify a bit by looking up ahead of time the cid of the data component, or just hardcoding it.