I have table like below
PARTICULAR OPENING TRANSACTION ENDING
Expense 5456456 0 0
Expense 0 1232131 0
Expense 0 0 123123
But I want to get the info like below
PARTICULAR OPENING TRANSACTION ENDING
Expense 5456456 1232131 123123
Is it possible to achieve this using sql query?
You want to SUM
it up, I guess!
SELECT particular,
SUM(opening) AS total_opening,
SUM(transaction) AS total_transaction,
SUM(ending) AS total_ending
FROM your_table
GROUP BY particular
It sounds like you just want
SELECT particular,
max(opening) opening,
max(transaction) transaction,
max(ending) ending
FROM your_table_name
GROUP BY particular
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With