MySQL Forums :: Newbie :: sum and display issue

Advanced Search

sum and display issue
Posted by: Akis Giannopoulos ()
Date: March 24, 2012 02:12PM


I've got a table like this:

id type amount
1 1 100
2 1 200
3 2 100
4 2 100
5 2 100

What I want is to sum the amount grouped by type and pass the result in two variables so I can display it like this

Type1 Type2
300 300

Is this possible somehow?

Options: ReplyQuote

Subject Written By Posted
sum and display issue Akis Giannopoulos 03/24/2012 02:12PM
Re: sum and display issue irek kordirko 03/24/2012 06:54PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.