MySQL Forums
Forum List  »  PHP

MIxed Query
Posted by: Gary Ehrenfeld
Date: September 30, 2018 07:44AM

How can I combine these into one query? I want to display the total days also.

SELECT DATEDIFF(MAX(Meter_Time), MIN(Meter_Time)) as totaldays
FROM meter

SELECT Historic_Glucose, Scan_Glucose FROM meter

$total_both = $total_historic + $total_scan;
$average = $total_both/$recordcount;
$a1c = (46.7 + $average) / 28.7;
echo '<div class="container">';
echo 'Total Days: ' . $totaldays;
echo 'Record Count: ' . $recordcount . '<br>';
echo 'Average: ' . round($average). '<br>';
echo 'A1c: '.round($a1c,1);
echo '</div>';

Thanks
Gary

Options: ReplyQuote


Subject
Written By
Posted
MIxed Query
September 30, 2018 07:44AM
September 30, 2018 09:46AM
October 01, 2018 08:02AM
October 01, 2018 09:49AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.