Please someone help me on the query.

I'm using oracle 11g. The column has many numbers. few are positive numbers, negative numbers are few, and few are zero.

the table structure is as this:

Col1

9

-5

3

60

10

-15

-45

0

87

Now, I have to count the number of positive, negative and all number the number zero of the column and display three columns like this:

Nega_value

Posi_value

Zero_value

3

5

1

What would the query?

Select sum (case when col1< 0="" then="" 1="" end)="">

sum (case when col1 > 0 then 1 end) posi_value,.

sum (case when col1 = 0 then 1 end) zero_value

from your_table

John

Tags: Database

Similar Questions

Maybe you are looking for

  • Reinstall 10.7.5 to help performance

    Late 2009 iMac 10.6.1 when new, now running 10.7.5 with 8 GB of memory and 2 TB of disk running My Mac worked slowly for a while. Check memory, CPU etc. in the activity monitor shows no reason for this. I want to reinstall the OS X 10.7.5 menu utilit

  • Firefox takes a long time to close

    There is a delay of 10 seconds after I click the 'X' to close Firefox. Same result with the "Exit" on the menu drop-down selection. It close much faster using "Alt - F4" or shut down the computer. Would this have something to do with some add-ons to

  • Sony Walkman NW-S205F

    I ordered a Sony Walkman NW-S205F music player recently. I have googled and looked in the manual of instructions, but I can't find a way to turn on the device. Help, please. I have pressed the display, play and even they button button held down for a

  • Pavilion Slimline s3400f: HP slimline s3400f desktop bluetooth

    HP Pavilion Slimline s3400f desktop PC - this computer has Bluetooth devices listed on the control panel.  I have a set of 2 wireless speakers UEBoom I want to use with the computer.  I lit one of the speakers and proceeded to Bluetooth devices on th

  • What has changed in Windows 7 solitaire?

    Solitaire in Windows 7 is different. In the previous OS (Vista) my win percentage was 20%. In win7 is 13% (same computer). In addition, I maybe paranoid, but it seems that very often on the basis of a choice of 2 options (2 Kings at the top battery a