大家好,我正在尝试改进我的查询以获得更好的性能是否可以以更好的方式编写此查询,非常感谢您的帮助
$query = " SELECT A FROM out_org where zone_id='1'";
$query2 = " SELECT A FROM out_dis where zone_id='1'";
$result = mysql_query($query);
$result2 = mysql_query($query2);
echo "<table border=1 style='background-color:#F0F8FF;' >";
echo "<caption><EM>my table</EM></caption>";
echo "<tr>";
echo "<th>" .OA. "</th>" ;
echo "<th>" .DA. "</th>";
echo "<th>" .total. "</th>";
echo "</tr>";
while($row = mysql_fetch_array($result) )
{
while( $row2 = mysql_fetch_array($result2)){
echo "<tr>";
echo "<td>" .$row['A']."</td>";
echo "<td>" .$row2['A']."</td>";
echo "<td>" .$total = $row['A'] - $row2['A']."</td>";
echo "</tr>";
}
echo "</table>";
}