我正在尝试用查询中的信息填充表格,但出现错误 500。我做错了什么?
for($count = 0; $count < $200; $count++)
{
$result = mysql_query("SELECT jp.ARTNUM, jp.BEZEICHNUNG, SUM(jp.MENGE), RDATUM
FROM journalpos jp, journal j
WHERE j.REC_ID=jp.JOURNAL_ID AND ARTNUM IS NOT NULL AND jp.JOURNAL_ID IN
(SELECT REC_ID FROM journal WHERE RDATUM BETWEEN NOW() - INTERVAL 1 DAY AND NOW() )
GROUP BY ARTNUM
LIMIT $count , 30")
or die(mysql_error());
$row = mysql_fetch_array( $result );
echo "<tr>";
echo "<td>";
echo $row['jp.ARTNUM'];
echo "</td>";
echo "<td>";
echo $row['jp.BEZEICHNUNG'];
echo "</td>";
echo "<td>";
echo $row['SUM(jp.MENGE)'];
echo "</td>";
echo "<td>";
echo $row['RDATUM'];
echo "</td>";
echo "</tr>";
}
它在没有 SUM 函数的情况下工作(然后我可以离开 GROUP BY)并且没有子查询!