title: MySQL query two lines as one
body: <p>I am working with data in CFDB (a database for contact forms) in CF7 (a forms plugin) in Wordpress. The data from the tables is organized in one table with the following columns. Each submission contains fields numbered from 0 to 9999 with #9999 always containing the login information for the submission. The submit_time variable is essentially the ID for the form submission. </p>
  
  <pre><code>ID      submit_time     form_name   field_name      field_value field_order file
  7881    1454460768.7523 Insurance   provider        UBH         0           NULL
  . . . 
  7900    1454460768.7523 Insurance   InsuranceCard   card.pdf    19          [BLOB - 71.8 KiB]
  7901    1454460768.7523 Insurance   Submitted Login email@e.com 9999        NULL
  </code></pre>
  
  <p>The file column is usually NULL unless there is a uploaded file.  I am trying to make a query that will list submissions with uploads in this particular format:</p>
  
  <pre><code>date                message_title   from_login  
  1454460768.7523     InsuranceCard   email@e.com 
  </code></pre>
  
  <p>So potions of the data are extracted from these two queries:</p>
  
  <pre><code>SELECT submit_time AS date, field_name AS message_title
  FROM wp_cf7dbplugin_submits
  WHERE field_order = 9999    
  
  SELECT field_value AS from_login
  FROM wp_cf7dbplugin_submits
  WHERE file IS NOT NULL  
  </code></pre>
  
  <p>How do I put them together to produce a list in this format:</p>
  
  <pre><code>date                message_title   from_login  
  1454460768.7523     InsuranceCard   email@e.com     
  </code></pre>