Script to display users and what they have spent

its giving me the username fine, but is not adding up the costs correctly just displays it as 100 for all users, have tried to change it but now its giving me a syntax error. any ideas?
insert into clubcosts(USER_NAME, TOTALSPENT)
     select
          u.user_name, count(cost)
     from
          users u, subscription_costs s, club c
     where
          u.user_id = c.club_id
     an
               (     select
                         null
                    from
                         club c2, subscription_costs s2
                    where
                         c.cost_id2 = s.cost_id2)
     group by
          u.user_name
)

user8652681 wrote:
its giving me the username fine, but is not adding up the costs correctly just displays it as 100 for all users, have tried to change it but now its giving me a syntax error. any ideas?
Many syntax errors in this. You shoul really try to build your sql statments step by step, not all at once. The select is and was never working.
just guessing
insert into clubcosts(USER_NAME, TOTALSPENT)
( SELECT u.user_name, nvl(sum(c.cost),0)
  FROM users u
  LEFT JOIN club c on u.user_id = c.club_id
  LEFT JOIN subscription_costs s on c.cost_id = s.cost_id
  GROUP BY u.user_name
);Furthermore if you get syntax errors it helps to read them and if you don't understand it, at least post them.
Edited by: Sven W. on Jul 24, 2009 2:44 PM

Similar Messages

  • Have a question about how to set up users and what they access

    I have just loaded logic studio on my computer on my admin account but i dont want it on the any other account and when i log in to another account on the same computer the program shows up. How do you **** let the admin account use the program and not the users? what do i have to set and where? do i need to go into users accounts or sharing? i cant seem to find anything. thanks for the help.

    Try looking at Parental Controls, in >System Preferences...>Accounts.
    Alternatively, you could put Logic in your user folder (/Users/your user name/Applications) (you'll most likely have to make that Applications folder, as well as make sure permissions are set so only you can access it, by using the "Get Info" window.

  • Users and what they may be attached to...

    Is there a way I can get a list of what a user may be attached to (jobs, programs, etc.).  I need to go through and do a mass deactivation of inactive users in the system, but I'd like to know if there is a report or something I can run that will tell me what their ID may be attached to.

    Hi Rakesh,
    I am actually looking for something that will give me info regarding what jobs, programs, etc. a user may be attached to.  I need to do a mass cleanup of users, but I neeed to know if I deactivate them if it will affect the ability for a certain job or process to run.  I don't know if there's a centralized place to find this information, but I'd rather know ahead of time rather than causing a job to fail because it's attached to a user that should have been deactivated long ago.  Hope this makes sense.

  • I want open a hotspot I have three iMac and 2 iPad 2 but I want control all the devices in my iPad like time and what they are watching?

    I want open a small hotspot I have three iMac and two iPad 2 but I would like to control everything from one iPad like time and what they are watching o copies too. What can I do? Please help me guys

    Home Sharing is designed to work on your local network not across the internet/cloud.
    Stuff is accessed under the Computers column where your local iTunes library on a local computer would appear.
    Home Sharing would share your iTunes content (i.e. stuff stored in itunes on the computer, not in the cloud) with AppleTV or an iPad etc on the SAME network.
    AppleTV2 will not be able to see itunes content on the work computer over the internet.  It's not designed to.  if the work computer was on the home network it would.
    iCloud is in it's infancy and is not a mature product - iTunes TV Show purchases appear on AppleTV, but currently music does not unless you are subscribed to iTunes Match. I find this rather odd to be honest, along with the inability to buy music on AppleTV2.  Movies purchased in iTunes are not authorised for iCloud viewing currently either.
    Maybe it has something to do with iTunes Match 'getting in the way' - i think they assume you'll use that whereas you really want to be able to access Purchased music from the cloud without subscribing to itunes Match which is overkill for some.
    AC

  • HT5622 I had this pop up: Add (phone number) for Facetime and iMessage. This phone number was associated with AppleID  on iPhone. I havent used it or done anything. What does this mean? Is someone using my ID and do they have my pasword.?

    I had this pop up: Add (phone number) for Facetime and iMessage. This phone number was associated with AppleID  on iPhone. I havent used it or done anything. What does this mean? Is someone using my ID and do they have my pasword.?

    If it isn't from something you did (like update iOS on an iPhone, or activate a new iPhone), then yes, I would be suspicious.

  • Is there a possibility to send from the Admin console the invitations to endusers in different languages? Somehow all the invitations go out in German but for my colleages in Spain and in the UK it makes it difficult to understand what they have to do wit

    Is there a possibility to send from the Admin console the invitations to endusers in different languages? Somehow all the invitations go out in German but for my colleages in Spain and in the UK it makes it difficult to understand what they have to do with this invitation. It doesn't help when I change the language in the admin console....Thanks for your help

    Hey Eric,
    Thanks for taking the time. Unfortunately no that does not solve it. Same as swipe it will get me there and it will show separate programs spaced out. The issue I am having is that all my open word files are bunched up in a pile on top of each other. I can see the edges of each one but I want them to be separated from each other enough that I can visually identify what file is what.
    Again, thanks for trying, it is appreciated.

  • Just installed mountain Lion. Viewing a pdf sent to me using preview and some colors are appearing BLACK, however when I view the same PDF in Acrobat they are perfect and what they are suppose to be. WHY would PREVIEW showing a different color?

    Just installed mountain Lion. Viewing a pdf sent to me using preview and some colors are appearing BLACK, however when I view the same PDF in Acrobat they are perfect and what they are suppose to be. WHY would PREVIEW showing a different color?

    Here's what I've found on the issue:
    Pantone color definitions have changed (coinciding with CS6) — they are now "Pantone+" (I think that's what they're called). The "+" apparently means they're now LAB colors. Lab colors are not properly displayed in Preview (or in Finder previews) — they display as black (as far as I can tell, in all circumstances). I'm sure it's a tad more complicated than that, but that's the gist.
    Now the bad news — nobody seems to know anything about a fix or workaround (unless you convert your PDFs to process — this might be a fix for sending to clients). It causes issues for me in AI files — being able to view them in the finder (with previews) is a HUGE time saver for my workflow... when they're all black, not so much.
    In my chat with a director of product dev at Adobe, they placed the responsibility to fix on Apple (assuming Apple wants to support Pantone color definitions in their OS).

  • Has anyone received an update on apple tv issue with HD movies and what they are doing about it

    Has anyone received an update on apple tv issue with HD movies and what they are doing about it

    Whatever the rep told you, it is complete nonsense. There is clearly a problem at your end, the Apple TV 3 is capable of more than the Apple TV 2, and you clearly have the Apple TV 2 working perfectly. Since the Apple TV 2 is able to download from the Internet properly, then my suspicion would be your problem lies on your local network. Interference is a common problem on local networks.
    Interference can be caused by other networks in the neighbourhood or from household electrical items.
    You can download and install iStumbler (NetStumbler for windows users) to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items.
    Refer to your router manual for instructions on changing your wifi channel or adjusting your multicast rate.
    There are other types of problems that can affect networks, but this is by far the most common, hence worth mentioning first. Networks that have inherent issues can be seen to work differently with different versions of the same software. You might also try moving the Apple TV away from other electrical equipment.

  • Hello everyone i have macbook air, hello everyone i have macbook air and my startup disc is full i checked everything and and find out that all space is of OTHER and i dont know what is it and what i have to do with that

    hello everyone i have macbook air, hello everyone i have macbook air and my startup disc is full i checked everything and and find out that all space is of OTHER and i dont know what is it and what i have to do with that

    First, empty the Trash if you haven't already done so. Then reboot. That will temporarily free up some space.
    According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation. You also need enough space left over to allow for growth of your data. There is little or no performance advantage to having more available space than the minimum Apple recommends. Available storage space that you'll never use is wasted space.
    If you're using Time Machine to back up a portable Mac, some of the available space will be used to make local snapshots, which are backup copies of files you've recently deleted. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as "Backups." The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself.
    To locate large files, you can use Spotlight. That method may not find large folders that contain a lot of small files.
    You can more effectively use a tool such as OmniDiskSweeper (ODS) to explore your volume and find out what's taking up the space. You can also delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one.
    Deleting files inside an iPhoto or Aperture library will corrupt the library. Any changes to a photo library must be made from within the application that created it. The same goes for Mail files.
    Proceed further only if the problem isn't solved by the above steps.
    ODS can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
    Back up all data now.
    Install ODS in the Applications folder as usual. Quit it if it's running.
    Triple-click the line of text below to select it, then copy the selected text to the Clipboard (command-C):sudo /Applications/OmniDiskSweeper.app/Contents/MacOS/OmniDiskSweeper
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The application window will open, eventually showing all files in all folders. It may take some minutes for ODS to list all the files.
    I don't recommend that you make a habit of doing this. Don't delete anything while running ODS as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means. When in doubt, leave it alone or ask for guidance.
    When you're done with ODS, quit it and also quit Terminal.

  • Having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this

    having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this.
    I'm using Lion on an MBP and Numbers is the latest version

    May you give more details about what is wrong with your dates ?
    M…oSoft products aren't allowed on my machines but I use LibreOffice which is a clone of Office.
    When I export from Numbers to Excel and open the result with LibreOffice, the dates are correctly treated.
    To be precise, dates after 01/01/1904 are correctly treated. dates before 01/01/1904 are exported as strings but, as it's flagged during the export process, it's not surprising.
    Yvan KOENIG (VALLAURIS, France) mardi 3 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : http://public.me.com/koenigyvan
    Please : Search for questions similar to your own before submitting them to the community
    For iWork's applications dedicated to iOS, go to :
    https://discussions.apple.com/community/app_store/iwork_for_ios

  • After I synced my iphone (4S with ios 8.1.2) using itunes with MS outlook on my new PC , suddenly all my contacts without telephone number and what I have the name of the contact only ?

    After I synced my iphone (4S with ios 8.1.2) using itunes with MS outlook on my new PC , suddenly all my contacts without telephone number and what I have the name of the contact only ?

    I couldn't find the edit button on my original post so I am posting an update here.
    I have gone through more apps and have had good luck on all but one more.  And it's not that the app doesn't work, I am talking about the Yahoo Weather app, It works fine, but when you swipe between cities the screen lags a bit and it sometimes doesn't move between pages the way it should.  On iOS 7.1.2 it was smooth as butter but on iOS 8.0, not so much.  I will post a note in the app store to let them know.  I really like the Yahoo app better than the new stock app.
    I have been going through my games and they all work fine. Angry Birds (Original and Stella), Canabalt, Minecraft, Bejeweled 2, Silly Walks, PopWords, Doodle Jump, Deep Green all seem to work just fine. 
    Starbucks app works as it should. 
    I will stop back again next week after I have had the weekend to play with it in detail and post my thoughts again.

  • How to set restrictions and what they mean

    How to set restrictions one the different oracle users and what can they do within the set restrictions, their limitations.

    What cardinality means

  • Where is list of keys and what they do?

    Where can I find a list of keys and what they do. I'm a command line kind of guy.
    Using Mac mini / Panther
    larryalk

    364/2810
    Hi larryalk,
    welcome to Discussions!
    In addition to Kurt's excellent link,
    Here are the ones you can print "just in case":
    - Shortcuts for freezes
    This one has all useful links:
    - Mac OS X keyboard shortcuts
    This one is very handy:
    - Mac OS: Apple Pro Keyboard Shortcuts for Shut Down and Restart
    Also:
    Many keyboard shortcuts are not documented. Just try holding the Option key in combination with the usual ones, see what it does. Same with the Control key and the Shift key.
    In popping dialog boxes:
    Usually command+dot = Cancel, and
    hitting the initial letter often equals a mouse-click.
    In the menubar and the menus:
    Also simply hitting a letter.
    Or two letters if needed, like HI = History when H(E) = Help.
    ⇧ Shift
    ⌥ Option
    ⌘ Command
    ⌃ Control
    Have fun!
    Axl
    Happy New Year Kurt!

  • Adobe reader xi i am running 2 display screens and when i have a file open and go to print the print page opens on my second screen.  How can I get adobe reader to just display on one screen?

    adobe reader xi i am running 2 display screens and when i have a file open and go to print the print page opens on my second screen.  How can I get adobe reader to just display on one screen?
    I want the capability of adobe reader to just run on one screen.

    I had the same problem.
    Try this.
    https://igppwiki.ucsd.edu/groups/publichelpwiki/wiki/a1538/Howto_Disable_Acrobat _as_the_Safari_PDF_Viewer.html

  • Both my iPad and iPhone have ios8 On either device in Calendars edit shared with add person when I enter an email address and press add nothing happens - just goes back to edit screen and what I have entered has gone. No error message or any clue

    Both my iPad and iPhone have ios8
    On either device in Calendars> edit >shared with> add person when I enter an email address and press add nothing happens - just goes back to edit screen and what I have entered has gone. No error message or any clue about why I cant share my calendar. Please help.

    UDPATE:
    Spoke with Express lane, and issue was escalated.  Kudos to the support guys that handled this one (Brian and Yi).  Went through everything in detail and took all the crash dumps off the iphones and ipads to send to engineering.
    After backing up the contacts, the recommendation was to delete all contacts in  iCloud.  Doing that caused my iCloud to crash (in the browser), so more crash dumps were sent to apple.
    Eventually got all contacts deleted, then did a resync.  Looks like IOS devices are coming back to life and syncing again.
    Also, Outlook iCloud connector has just been updated to ver 1.0.1 so i installed that on their recommendation.
    BOTTOM LINE workaround:
    1. Backup contacts
    2. Delete contacts in iCloud
    3. Delete accounts on IOS devices
    4. Recreate accounts on IOS devices.
    Hoping a real root cause can be found and real fix implemented.  This has caused me to doubt the stability of iCloud, so i will procees with caution.

Maybe you are looking for

  • Can No Longer Burn DVDs

    I have a Lenovo G700 series laptop and have recently found that I can no longer burn DVDs.  I can burn CDs and the drive can read DVDs & CDs. I trawled the forums for any clue of what has gone askew including the registry fix, tried different media,

  • Asset depreciation issue after Credit memo posted to asset.

    Hi, We bought asset on 2010 Dec with price 100,000 SGD last year. The asset, monthly depreciation = 833.33 SGD with 20 year useful life. This month, we received an CN to minus 20,000SGD for some reason. Hence I do credit asset with transaction type 1

  • Sun One Application Server 8.2

    I was wondering if anybody used Creator 2 with Sun One Application Server 8.2????????? I did create a war file from the project that I build and tried to deployed it with Application Server 8.2. The deployment was successful, but when I am tried to s

  • Need documents on presentation variable...

    Hi Everyone, Am struggling on concepts of presentation variable, so i really need some basic documents or website links on presentation variables to learn with examples will be really thankful. Regards s

  • Restore database noarchivelog to another server in ASM

    I have to migrate a database 10g with noarchivelog with filesystem to another server with ASM. Could you help me to do it? Thanks.