如何计算单个Oracle ID的不同列值并将结果显示为列

时间:2014-04-22 09:22:55

标签: sql-server

如何计算单个Oracle ID的不同列值并将结果显示为列

        Oracle  | Status| other columns |   
        41      |  A   |
        52      |  W   |
        41      |  A   |
        52      |  W   |
        41      |  W   |
        __________________
        I need a resulting query that shows the count of distinct Status in every Oracle like this:

        Oracle | Total(A) | Total(W) |    
        41     |    2     |     1    |
        52     |    0     |     2    |

0 个答案:

没有答案