This is my output tabe:
name SUM(billing.quantity) SUM(billing.total) SUM(billing.discount) SUM(billing.price)
pen 4 40 8 32
pencil 3 15 2 13
rubber 1 2 1 1
Using :
SELECT productmaster.name, SUM(billing.quantity), SUM(billing.total), SUM(billing.discount), SUM(billing.price) FROM billing AS billing LEFT JOIN productmaster AS productmaster ON (productmaster.id = billing.pid) GROUP BY billing.pid ORDER BY productmaster.name ASC
My doubt is , my output should be like
name quantity total discount price
pen 4 40 8 32
pencil 3 15 2 13
rubber 1 2 1 1
How ? Can any one? I need your help?
AntonyRayan
15
Posting Whiz in Training
Recommended Answers
All 3 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
AntonyRayan
15
Posting Whiz in Training
AntonyRayan
15
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.