LifeinAsia - 7:26 pm on Jun 29, 2010 (gmt 0)
Off the top of my head, this should work (if you're using MS SQL):
SELECT totals.id, SUM(totals.price)
FROM (SELECT bills.id as id, IsNull(items.price,0) AS price
FROM bills LEFT OUTER JOIN items ON bills.id=items.id) AS totals
GROUP BY totals.id
If your DB doesn't have an IsNull function, you'll have to pay with it a bit.