To get the count of records and able to access the column value in a single

Hi
Is there any way to get the number of records in the query and access the column values
e.g
select count(*)
from
(SELECT department, COUNT(*) as "Number of employees"
FROM employees
WHERE salary > 25000
GROUP BY department ) a
This wil only get the Count, if i want to access each row from the inline view how can i do that.

Your question is not clear.
Are you looking for total record count as well as count by department ?
Something like this?
SQL>
SQL> with temp as
  2  (
  3  select 1 dept ,10000 sal from dual union
  4  select 1 dept ,25100 sal from dual union
  5  select 1 dept ,30000 sal from dual union
  6  select 1 dept ,40000 sal from dual union
  7  select 2 dept ,10000 sal from dual union
  8  select 2 dept ,25100 sal from dual union
  9  select 2 dept ,30000 sal from dual union
10  select 2 dept ,40000 sal from dual )
11  select count(*) over( partition by 1 ) total_count,dept,
12  count(*) over(partition by dept) dept_cnt  from temp
13  where sal>25000;
TOTAL_COUNT       DEPT   DEPT_CNT
          6          1          3
          6          1          3
          6          1          3
          6          2          3
          6          2          3
          6          2          3
6 rows selected
SQL>

Similar Messages

  • My iPhoto browser just doesn't load. The app is responsive and I can access the menubar, but no options to click. There is just no iPhoto browser. I don't have a clue what to do.

    Whenever I try to load iPhoto, the icon bounces in the dock, the menubar changes, but the iPhoto photo browser/window never appears. Most of  the menubar drop-down windows are greyed out. I'm not sure what else I can add to this, this is really strange for me. No spinning beachball, just an empty screen.
    I'm running Lion 10.7.3 and I have iPhoto 11 (9.2.1). 
    What can I do?

    Try trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder.
    (On 10.7: Hold the option (or alt) key while clicking on the Go menu in Finder to access the User Library)
    (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    What's the plist file?
    For new users: Every application on your Mac has an accompanying plist file. It records certain User choices. For instance, in your favourite Word Processor it remembers your choice of Default Font, on your Web Browser is remembers things like your choice of Home Page. It even recalls what windows you had open last if your app allows you to pick up from where you left off last. The iPhoto plist file remembers things like the location of the Library, your choice of background colour, whether you are running a Referenced or Managed Library, what preferences you have for autosplitting events and so on. Trashing the plist file forces the app to generate a new one on the next launch, and this restores things to the Factory Defaults. Hence, if you've changed any of these things you'll need to reset them. If you haven't, then no bother. Trashing the plist file is Mac troubleshooting 101.

  • I have looked at the service manual to be able to access the App store and Itunes, to no avail, still not successful.

    I have viewed the download sevice manual to be able to acess itunes and the apps store,and applied all settings which are recommended, to no avil my iphone still prompts me to " Cannot connect to iTunes Store or Apps store, does anyone have any step by step instructions for me.  I have attempted may times to resolve this issue with no success.  Any advice would be appreciated,
    Tq1

    Hello everyone,
    This is Tq1, when I first joined this community I received enormous responses for my requests, now after seeing  there were 11 views and no remarks posted I am wondering where has all the love gone?  Just a joke don't take it personally, for those of you who have replied to past questions on this post I am extremely grateful.  I hope you all have a wonderful and great day.
    Tq1   

  • Hey I'm trying to use the back up assistant and trying to access the messages.

    How do you get to them on the site?

    Great question jwithers102!
    Did you have the Verizon Messages app downloaded to your phone? You can go to www.verizonmessages.com to log in and access your messages on My Verizon.
    Thanks,
    TamaraH_VZW
    Follow us on Twitter @VZWSupport

  • I want to be able to tweak the graphic equalizer in real time while recording - and have this have the audible effect written to the recording.   At the moment i have to go into post-production and manually set the graph equalizer at various time points .

    i want to be able to tweak the graphic equalizer in real time while recording - and have this have the audible effect written to the recording.
    At the moment i have to go into post-production and manually set the graph equalizer at various time points ...

    This won't be real-time as you record, but you could tweak the EQ in real-time after the recording thus:
    Record what you want to tweak into GB with no effects.
    Solo the track and output it into something like Audacity.
    Start Audacity recording, then play your track in GB as you make those tweaks. That's what Audacity will record.
    Get that file from Audacity and put it into GB, then you'll have that effect.
    Sorry if it's complicated, but that's what came to mind. Hope it works.

  • I am not able to access the "Settings" on my iPad 3. I just get a gray screen for about 30 seconds and then the app shuts down. I am also unable to access the App store, iTunes, or any app requiring an internet connection. Any thoughts?

    I am not able to access the "Settings" on my iPad 3. I just get a gray screen for about 30 seconds and then the app shuts down. I am also unable to access the App store, iTunes, or any app requiring an internet connection. Any thoughts?

    First, try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."

  • Hi, i hav an Iphone 4S (ios 7.1) with me.. it is abnormally increasing its temperature due to no reason and i am really worried about that. The fully charged phone is getting empty within minutes. Not able to attend the calls due to its overheating. help

    Hi, i hav an Iphone 4S (ios 7.1) with me.. it is abnormally increasing its temperature due to no reason and i am really worried about that. The fully charged phone is getting empty within minutes. Not able to attend the calls due to its overheating. help me please..
    It shows a 'temperature rise, need to cool down your phone' message regularly.. It happens when i when i try to connect my fone to the internet using cellular data, and it happens more suddenly when my 3g is on.. help me to sort out this, please

    Make an appointment with the Apple genius bar for an evaluation.

  • Getting the count of records in a cursor

    Hi,
    How can I get the count of records satisfying a conditin in a cursor.
    This is the code that I have written. Please tell me where I am going wrong.
    declare
    cursor c is
    select * from Details where Name like 'M%';
    rec number;
    r c%rowtype;
    begin
    for r in c
    loop
    rec:=rec+1;
    end loop;
    dbms_output.put_line(rec);
    end;
    Thanks in advance

    Hi,
    You have to initialize the rec variable.
    declare
    cursor c is
    select * from Details where Name like 'M%';
    rec number :=0;
    r c%rowtype;
    begin
    for r in c
    loop
    rec:=rec+1;
    end loop;
    dbms_output.put_line(rec);
    end;
    You can also use the %ROWCOUNT attribute.
    Regards

  • I have been using Itunes on my HP laptop for 12 months and over the past month have not been able to access the Itunes store or any of the Itunes Help type menu's. When in Itunes I click on the Store icon and the top middle box gets to Half way. Pls help

    I  have been using Itunes on my HP laptop for 12 months and over the past month have not been able to access the Itunes store or any of the Itunes Help type menu's. When in Itunes I click on the Store icon and the top middle box gets to Half way. Pls help

    I had the same tried loads of fixes
    saw this on the community from whatheck
    In windows 7 click on your start menu, go to the accessories, right click on the command icon and choose "run as administrator"
    Once it opens type the following command...
    netsh winsock reset
    Hit enter and it should say something like winsock reset successful now reboot your computer
    IT WORKED....... cleared all the "action2 on the CPU and loads IStore perfectly

  • On my iPod touch I can't access the 'Lock Sounds' feature. I have no sound and I can't get to the volume limit nor do i have the passcode once i am able to access it, any suggestions?

    On my iPod touch I can't access the 'Lock Sounds' feature. I have no sounds and I can't get to the volume limit feature nor do i have the passcode once i am able to access it, any suggestions?

    On my iPod touch I can't access the 'Lock Sounds' feature. I have no sounds and I can't get to the volume limit feature nor do i have the passcode once i am able to access it, any suggestions?

  • To download an App the 3 security questions are required. But at the end, apple is not able to complete the task and gives an error message. No more downloads are possible. What can I do?

    to download an App the 3 security questions are required. But at the end, apple is not able to complete the task and gives an error message. No more downloads are possible. What can I do?

    Very Important, how much Free Space is on your Hard Drive first of all? Click on the Macintosh HD on the Desktop, then do a Get Info on it.
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.
    Do they launch OK while in Safe Mode?

  • How do I get my iTunes (both purchased and cd's) into the cloud as I cannot use match my iMac and MacBook are too old to use the right OS and maxed out RAM memory upgrades, but have iPhone 4S and now 64gb iPad and libraries on desktops plus iPod!!

    So very excited bought iPad and new speakers today! Want to get all my music sorted as across iMac (G5), MacBook os 10.6 (maxed out ram and memory) and old iPod. Saw Match would be an option but can't use due to old OS so I can get the raw music library files but then what do I do to get all in one place? Any help appreciated.

    A good route would be to attach a USB drive to the macbook.  You can use the drive to assemble a copy of all of your music from your various devices.  iTunes on the macbook can be used to create a new library, located on the USB drive, into which you can import all of your music.
    Two major benefits:
    1.  From here you can run iTunes Match across your entire music collection; and
    2.  You will have created a full local backup of all of your music on the USB drive.
    Once complete you will be able to access the music from any iDevice capable of running iTunes Match,  Do remember as you add music it is important to maintain a local backup in order to keep your music safe.

  • How to know the count of record in CR XI?

    Post Author: Liu ming
    CA Forum: Deployment
    Hi All,
    I create a report by CR XI release 2. The report is viewed in ASP.Net. So, I would like show a message when the report have no record. My question is how to know the count of record?
    Thanks.

    I was able to do this by using
    ora:countNodes('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500')

  • Upgraded to Mountain Lion and CS3, I am no longer able to access the correct dialog box for fine printing with Epson Stylus Photo 1400.

    I have recently upgraded my Mac OS to Mountain Lion, and am using Photoshop CS3 together with Lightroom 5. To my absolute horror, in either Adobe program I am no longer able to access the dialog box which allows me to choose paper type, size, and print quality when attempting to print on my Epson Stylus Photo 1400. An excruciating hour on the phone with largely unintelligible folks at Epson seemed to prove the problem lies with Adobe instead of Epson. I'd greatly appreciate whatever advice might be forthcoming from the Community.

    Well, this seemed to work.. can't believe it! After a year of messing with this!
    from Stevejones5
    "I found a way around this problem. GO to HD/Library/Printers/Epson/InkjetPrinter/ICCProfiles and you will find a file labeled Pro38.profiles. This is a package file. Control click on it and reveal contents. Then you can copy all the profiles and paste them into your Colorsync folder either in the HD/Library folder or your own Home folder/Library. Then the profiles will show up in Photoshop and Lightroom."
    Key, is to Control click on the printer to "Open contents". Then open Resource folder. Copy everything in it and then paste it into the "Colorsync" folder in your Library.  (Remember, to get to Library you have to hold the command key down for it to appear in "Go" Menu for Finder.
    Then I reinstalled printer driver from Apple, then rebooted computer, then plugged in printer. And VOILA-- I can now select Epson Premium Photo Paper Luster!

  • My i phone 4s, battery died and now wont come back on just vibrates on charge but will not come on, have tried rebooting i just want to be able to access the memory to back up the phone to icloud  as i stupidly have not done this yet is this still possibl

    My i phone 4s battery dies and now wont switch back on, when plugged into the charger it just vibrates and sometimes beeps, but the screen will not come on? i have tried rebooting it but it still wont work, i just need to be able to access the memory so i can save all my stuff to icloud as i stupidly havent done this yet, is there anyway this can be done?

    Hey tessatony,
    Thanks for the question. I understand that your iPhone 4s is not functioning properly, and that you wish to try to make a backup before troubleshooting. From the information you have provided, it sounds like the device is indeed turning on and responding when plugged in, however the display is not lighting up. Have you attempted to plug the iPhone into a computer with iTunes? If iTunes recognizes the phone, you can attempt to back it up:
    iTunes: About iOS backups
    http://support.apple.com/kb/ht4946
    Afterwards, attempt to restart and/or reset the phone:
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430
    If your issue persists, your iPhone may need to be serviced. The following link should help you get started with the process. Included, you will find information on topics such as warranty, service pricing, and express replacement service.
    Apple - Support - Service Answer Center
    http://www.apple.com/support/iphone/service/faq/
    Thanks,
    Matt M.

Maybe you are looking for