Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- MySQL SUM


deimon - 7:11 pm on Jun 29, 2010 (gmt 0)


Hello, i have 2 tables :

Bills: id.......

Items: id | price.....

.. its tables in my billing program, where i need show all bills ..

i wrote sql query as :

SELECT bills.id, SUM(items.price) FROM bills, items, WHERE bills.id = items.id

but they wrote only rows, where is some items ... bills where not any items not shows.

I need show all bills (where isnt any items show "0")

Have you some ideas ?

Thanks


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4161546.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com