mysql - SQL transactions sum for each year -


this question has answer here:

i have table tranaction date , transaction price. so:

  • 12/01/08 $1500
  • 20/05/08 $1200
  • 09/08/15 $2000
  • 12/09/15 $3000

i want able find sum of transactions each year. how add them together. know how add example + example "example".

select transaction_id, transaction_date, transaction_amount transactions_table

thanks!

you'll need like:

select sum(transaction_amount), transaction_date transaction_table group year(transaction_date) 

this sum transactions , group them year.


Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -