Welcome Guest, Not a member yet? Register   Sign In
How to Get Count in single query.
#1

[eluser]Sudz[/eluser]
Hi

my table structure is like this

table 'transacttion'
-------------------
id | status | amount
--------------------
1 | fail | 50
2 | success | 100
3 | fail | 50
4 | pending | 100
5 | fail | 50
6 | success | 100

I want get Count of fail transaction,success transaction,and total amount of particular status
How should i get it in single query
plese anyone help.

I want to display report like this
----------------------------------
|success|fail|pending
-----------------------------------
Total records |2 |3 | 1
-----------------------------------
Total Amount | 200 |150 |100
------------------------------------

Please anyone.


Messages In This Thread
How to Get Count in single query. - by El Forum - 05-13-2011, 12:09 AM
How to Get Count in single query. - by El Forum - 05-13-2011, 12:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB