Here is a working join code:
SELECT
?*
FROM
?(
? ?SELECT
? ? ?<code>submit_time</code> AS 'Submitted',
? ? ?max(
? ? ? ?if(<code>field_name</code> = 'quantity', <code>field_value</code>, null)
? ? ?) AS 'quantity',
? ? ?max(
? ? ? ?if(<code>field_name</code> = 'id', <code>field_value</code>, null)
? ? ?) AS 'id',
? ? ?GROUP_CONCAT(
? ? ? ?if(
? ? ? ? ?<code>file</code> is null
? ? ? ? ?or length(<code>file</code>) = 0,
? ? ? ? ?null,
? ? ? ? ?<code>field_name</code>
? ? ? ?)
? ? ?) AS 'fields_with_file'
? ?FROM
? ? ?<code>wp_6_cf7dbplugin_submits</code>
? ?WHERE
? ? ?<code>form_name</code> = 'Table2'
? ?GROUP BY
? ? ?<code>submit_time</code>
?) AS Table2
?LEFT JOIN (
? ?SELECT
? ? ?<code>submit_time</code> AS 'Submitted',
? ? ?max(
? ? ? ?if(<code>field_name</code> = 'id', <code>field_value</code>, null)
? ? ?) AS 'id',
? ? ?max(
? ? ? ?if(
? ? ? ? ?<code>field_name</code> = 'name',
? ? ? ? ?<code>field_value</code>,
? ? ? ? ?null
? ? ? ?)
? ? ?) AS 'name',
? ? ?GROUP_CONCAT(
? ? ? ?if(
? ? ? ? ?<code>file</code> is null
? ? ? ? ?or length(<code>file</code>) = 0,
? ? ? ? ?null,
? ? ? ? ?<code>field_name</code>
? ? ? ?)
? ? ?) AS 'fields_with_file'
? ?FROM
? ? ?<code>wp_6_cf7dbplugin_submits</code>
? ?WHERE
? ? ?<code>form_name</code> = 'Table1'
? ?GROUP BY
? ? ?<code>submit_time</code>
?) AS Table1 ON Table1.id = Table2.id;
Now going to wrap it on PHP and in WordPress.