I have the code below
$sql = "SELECT
date1,
date2,
userid,
jobid,
result,
price,
total,
(SELECT distinct SUM(total1) FROM Jobs) as total2
FROM
Jobs
WHERE
total <= total1
GROUP BY
'$newphrase', '$newphrase1', '$user', '$job', result
ORDER BY
jobid DESC, userid DESC";
$result = mysql_query($sql);
it outputs a grand total but it outputs it 3 times the output is below
SN01 0.17 15 2.55 25.05
SN01 0.50 15 7.5 25.05
SN01 1 15 15 25.05
the 25.05 is output 3 times i need it just once. I have tried distinct and everything i can think of Please help its driving me nuts