Mysql
 sql >> Datenbank >  >> RDS >> Mysql

PHP MYSQL SUM insgesamt, aber Zeilen anzeigen

Probieren Sie dieses SQL aus

SELECT * FROM
(
    SELECT *, @total:= @total+ `companyearned` AS `total`
    FROM `recordedhours`, (SELECT @total:=0) r WHERE `group` = '$uid'
    ORDER BY `unixdate` ASC, `idnum` DESC
    LIMIT $from, $max_results
) tab ORDER BY `unixdate` DESC