Ryan
2007-08-21 08:18:00 UTC
This is the first time I have run into this problem. My MSSQL is as follows:
SELECT p.name, r.res_id, py.payment_total, sum(py.payment_total) AS
payment_net
FROM bat_packs p INNER JOIN bat_res r ON p.pack_id = r.pack_id INNER JOIN
bat_payments py ON r.res_id = py.res_id
WHERE r.res_id = 1194
GROUP BY p.name, r.res_id, py.payment_total
I recieve all the current information except the corrent payment_net, which
is supposed to the SUM of the payment_total column. What I am actually
getting is the exact same amount as the payment_total per row. What's going
on??
SELECT p.name, r.res_id, py.payment_total, sum(py.payment_total) AS
payment_net
FROM bat_packs p INNER JOIN bat_res r ON p.pack_id = r.pack_id INNER JOIN
bat_payments py ON r.res_id = py.res_id
WHERE r.res_id = 1194
GROUP BY p.name, r.res_id, py.payment_total
I recieve all the current information except the corrent payment_net, which
is supposed to the SUM of the payment_total column. What I am actually
getting is the exact same amount as the payment_total per row. What's going
on??