Getting multiple aggregations in Single statement

Posted by Harikrishnan R on Stack Overflow See other posts from Stack Overflow or by Harikrishnan R
Published on 2012-09-05T20:52:05Z Indexed on 2012/09/05 21:38 UTC
Read the original article Hit count: 220

Filed under:
|

The table has data of city and its branchs/atms

CITY        TYPE       NAME
 ----------------------------------
 agra         atm         X
 agra         branch      X1 
 delhi        atm         X2
 agra         atm         X3
 agra         atm         X4
 delhi        branch      X5
 chennai      branch      X6

The result set expecting is

CITY     ATM   BRANCH
------------------------------------
agra       3       1 
delhi      1       1
chennai    0       1

Whether we can do this in one select statement.

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about plsql