Page 1 of 1

sql syntax error. Attempting to round to 2 places

Posted: Sun Dec 19, 2010 8:20 pm
by stuckne1
I'm attempting to round my result to 2 places. After using google, this is what I came up with. It says I have a syntax error though. Help greatly appreciated.

Code: Select all

SELECT ROUND(SUM(amount),2) / (SELECT COUNT(roommate_id)  
FROM t_roommates
WHERE room_id = 1)
FROM t_roommates
JOIN t_transactions ON
t_roommates.roommate_id = t_transactions.roommate_id
WHERE room_id = 1