A better way to differentiate positive vs. negative numbers and sum them ?

Hi, I wonder if there is a better or easier way to differentiate the positive numbers from negative ones and sum them respectively?
I come up with below:
create table t1 (num number, id varchar2(3));
insert into t1 values  (-100, 1);
insert into t1 values (50, 2);
insert into t1 values  (-10, 3);
insert into t1 values  (-20, 4);
insert into t1 values  (50, 5);
insert into t1 values  (60, 6);
select sum(decode(sign(num), 1, num, 0)) plus, sum(decode (sign(num), -1, num, 0)) minu from t1;
PLUS   MINU
160     -130Any suggestion would be appreciated! Thanks

if there is a better or easier way to differentiate the positive numbers from negative ones and sum them respectively?Maybe you want them in different rows than in different columns:
SQL> select sign(num), sum(num) from t1 group by sign(num)
SIGN(NUM)   SUM(NUM)
         1        160
        -1       -130
2 rows selected.?

Similar Messages

  • After saving a pdf as Excel workbook the numbers remain text and cannot be used in calculations. Is there a better way to convert into real digital numbers?

    After saving a pdf as Excel workbook the numbers remain text and cannot be used in calculations. Is there a better way to convert into real digital numbers?
    I have tried to convert the pdf to Word instead but same difficulty with numbers: look like numbers but not usable for calculations

    Excel has a 'text to numbers' function, I would use that.
    Convert text to numbers. Microsoft Excel.

  • How to know if there are more positive or negative numbers?

    I will try to explain my problem with an example, since in the computer I don't have labVIEW installed.
    I have 10 numbers and multiply it for 10 other numbers
    and of course i will have 10 results, after it I have to show the meddium value of this 10 results and have to show the signal that most appear (+ or -)
    My problem is to show the signal, if I have 7 negative numbers and 3 positive numbers, how can I measure it and show the negative signal in the final?
    example:
    -0,3 -0,8 1 0,3 0,6 -0,7 -0,1 -0,5 0,3 -0,4
    So i have to put in the final:
    - 0,5
    Thanks
    Solved!
    Go to Solution.

    Here is code that gives you -0.5 from the given data. Still, sounds pretty useless.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    minuszeropointfive.png ‏2 KB

  • Is there a way to move a group of tabs to a new window? I know how to move one tab to a new window, but is there a way to mark a group of tabs and move them to a new window?

    Is there a way to move a group of tabs to a new window? I know how to move one tab to a new window, but is there a way to mark a group of tabs and move them to a new window?

    * Tab Mix Plus: https://addons.mozilla.org/firefox/addon/tab-mix-plus/

  • Is there a way to listen tracks from my harddrive and delete them directly?

    Hello Everybody,
    I have a simple thing i like to do, but i can't figure out how to do it..
    I have a lot of music on my external harddrive, and i want to listen to a track and if i don't like it i want to delete it.
    I don't like using itunes, because a lot of tracks are not part of an album and then i can never find them again. I use traktor to browse to my folders, but from that program i can't delete the tracks. Then i have to search for the track in finder..and delete it from there.
    Is there a way to listen to my tracks from my harddrive and delete them on the spot?
    kind regards,
    Marco

    Rocam wrote:
    i cannot delete a track from itunes and directly from my harddrive at the same time...
    Well you can place it in the Trash, then delete the Trash all at once.
    Right click on the song in the Library and select Delete.
    This next window can be prevented to show again by checking the Do Not Ask Me Again box
    Bam, click the Move to Trash and it's in the Trash,
    when your done for the day, before you remove any media, you click Finder > Empty Trash and they are all gone at one time.
    This method is better in case you make a mistake, you can grab it out of the Trash and put it back.
    I think the Delete key on the keyboard is even faster than the right click selection, you'll have to find out.
    You also can use something like QuickKeys and scheduale a sequence of mouse click events so a simple keystroke like Control D can delete the song to the Trash.

  • I have transferred all my music from iTunes onto my USB to play on my car audio radio. The radio reads the music but does not play it in sequence. There is a specific way to save the music into folders and name them. I have a Pioneer DEH-2350UBSW.

    I have transferred all my music from iTunes onto my USB to play on my car radio. The radio reads the music but does not play it in sequence. So it plays certain folders, then it skips folders. in certain folders it skips tracks. apparently there is a specific way to save the music into folders onto the USB with regard to naming the tracks and folders.. I have a Pioneer DEH-2350UBSW. Can anyone please help.

    It is a stick, Cruzer Blade 16gig.
    In the manual it says the following about the USB storage device:
    1. Playable folder hierarchy is up to 8 tiers
    2. Playable folders up to 500
    3. Playable files up to 15 000
    Under sequence of audio files it says that the user cannot assign folder numbers and specify playback sequences with this unit. It also gives an example of a hierarchy:
    01 - folder
    Under that is 02 which is also a folder
    Under that are compressed audio files 01 to 05: folder number
    Under that there is another folder same concept as above - I have attached that part of the manual in this response.
    I named my folder - Folder 001 Artists name and then in that folder I added the tracks as:
    001 Song title
    002 song title
    It played the 1st song in the folder and skipped to the next folder, I can't even locate the other tracks.
    On another folder I saved 31 songs but only 29 played so I am not sure whether there is a limit.
    All I need is an example of how to number and name everything.

  • Why are SPAM messages showing hits=negative numbers and getting through?

    Message headers in known SPAM are reporting NEGATIVE numbers!
    How do I figure out what rule is pushing them into the negative?
    No wonder SPAMASSASSIN isn't catching much.
    ===========================================
    Here are headers of two SPAM messages:
    X-Spam-Status: No, hits=-4.102 tagged_above=-999 required=3
    tests=ALL_TRUSTED,
    AWL, BAYES_00, HTML90100, HTMLIMAGE_RATIO06, HTML_MESSAGE
    X-Spam-Level:
    ==============================================
    X-Spam-Status: No, hits=-3.283 tagged_above=-999 required=3
    tests=ALL_TRUSTED,
    BAYES_00, HTML90100, HTMLBADTAG_0010, HTMLIMAGE_RATIO02,
    HTML_MESSAGE,
    HTMLTAG_EXISTTBODY
    X-Spam-Level:
    ===============
    Does that mean that one or more of the tests shown above has to be the culprit?
    Thanks,
    Keith

    This is the test you do not want to trigger for external mail: ALL_TRUSTED
    Chances are you are using NAT. For a solution see here:
    http://wiki.apache.org/spamassassin/TrustPath
    HTH,
    Alex

  • During diction, is there any way to differentiate between the number "2" and the word "to ?

    :

    Well, what you have just been witness to is the lack of A.I.  Without AI, a computer cannot properly comprehend certain convesational criteria.
    Humans and other animals do not take actions or words at basic face value.  They apply learned data from past experiences to better match the context of the actions or words presented to them.  Once their brain settles on a % of correctness, it spits out a response value for it.  Computers don't currently do that... at least not yet and those that have wannabe AI logic on them still have a hard time making the right decision.  For the most part, they go with face value based on programmed parameters that are always applied the same way.
    It's like the thermostat in your house.  It's been told that if it's below a certain temp it needs to kick the heater in, if it's above a certain temp, it needs to kick in the AC.  But, if the temp is below a certain value and you just happen to have a sweater on which is keeping you warm, the termostat won't know that it's OK for it not to turn the heat on to warm you up.  It's a crude example, but you get the idea.

  • What is the best way to differentiate a flatten pdf file and a mult-layers (live) file

    Hi All,
    I am using Adobe Acrobat 9.3.
    I have over 10,000 pdf files saved in the same directory. Some of them have been flatten while some of them are still live.
    All the files need to be flatten and I need to identify all the live files.
    Is there any way I can identify them without going through one by one?
    Is there any program I can use?
    Appreciate for your help.
    Thanks,
    Chris Wong

    You can use JavaScript to tell if there are any layers in a document. You could use it in a batch sequence that checks all of the files in a directory and print the filename to the JavaScript console for each file that has layers.
    For more information, see:
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.482.html
    http://acrobatusers.com/tutorials/2006/create_use_layers
    You can also use JavaScript to run a Preflight profile that yo've set up to flatten layers. For more information, see:
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.510.html

  • HT4759 is there any better way you can track stolen iphone 5 and iphone 5s rather than find my iphone?

    i have lost iphone 5 and iphone 5s within 4 month, its real sad coz there is no way i can track them, have been using icloud (find my iphone) for all these time but it doesn't show nothing helpful rather than my iphones are offline. i need help on this please.....

    Find my...is the only way to track a device.
    Barry

  • Is there any way to differentiate between R12 gl records and 11I?

    Hello all,
    is there any way we can tell if a record is r12 or 11I aside from basing this on when we upgraded? We run reports that use reference_XX data from the g_je_lines table. The references have changed for R12 so we need to get the required data 2 different ways.
    Thanks.

    You can use je_header_id.
    Since it is sequential, you can say je_header_id >= x is R12.

  • Please make it easier to position images in height and have them adapt to browser width!

    Maybe I'm missing a method but I have now long enough stumbled on something I would think obvious to exist within the program.
    I just want a highres intro image to pop up. i want to position it a bit down from the vertical center, but it should fill out left and right.
    1. Tried using slide shows, but Lightbox won't autostart without clicking thumbnails first. Only fullscreen lightbox has this ability for some unexplicable reason. Please make the non fullres lightbox available for immediate popup without having to click thumbnail.
    2. Tried using background browser fill. Works to a degree, but I can't control the image's vertical position.
    3. Tried using a 100 % width box and fill it with my highres image. But this wont work for this utterly strange reason:
    If I use a 960 px page width as my template, create a box 100% width, I try filling it with my image and tell it to scale to fill. But here's the bummer: If I resize my browser window to accomodate a 2560 px wide screen - my highres image was shredded when I assigned it to fill the 960 px wide box. It's looking a disaster at 2560 resolution. Please allow the image fill to retain it's original size and be able to rescale to smaller sizes instead.
    Because downward scaling doesn't seem to work in fills.
    So to boil it down: I want to be able to make a box and set it to 100 % browser width in the entry box, not having to graphically drag it out to whatever page width I'm currently using in Muse. I should be able to fill it with an image of any size, without Muse making any decision and downsampling my image, making it unusable for 100 % width display on high resolutions.
    Please consider this!
    T

    >@Ian Lyons: I can't drag the panels but the scroll-wheel on my mouse works fine...far better than it did in LR1.
    Agree--when LR is on the main display, but the scroll wheel does NOT work for scrolling the panels when LR is on the 2nd display. I don't know if this is intentional or an oversight or just a situation I experience, but I have experienced it with all versions of LR and in both XP and Vista.
    Note that the scrolling of the side panels isn't the only thing that doesn't work properly with the scroll wheel when LR is on the 2nd display--the thumbnail panel doesn't scroll when on the 2nd display, either. However, using the scroll wheel to adjust brush sizes works fine on either display as does scrolling the thumbnails in the Grid view.

  • The drop drop down box from Yahoo that says "Do you use the Yahoo! Toolbar on multiple computers? will not respond to clicking on it. It Stays in the drop down position covering other tabs and makes them unuseable.

    this box with three options: learn more, save to my Yahooa1 ID, No thanks, just save to this computer, will not respond when any option is selected. It will not go away. It covers other tabs making them useless.

    Did you ever figure this out? I bought my iPad last week to use in my business as well. I assume you are trying to use alldata? That is where I noticed this same issue. I had problems with identifix working with safari but downloaded a different browser and that works fine. Alldata does not work with either browser. The main difference is that on identifix if there is only one engine selection, it automatically selects the only option and continues to the home page. With alldata you have to make the selection manually even if there is only one option. Honestly if I can't get this to work I am going to return the iPad as it looses a significant amount of usefulness to men

  • Is there a way to create multiple New Tabs pages and name them?

    This feature is great but I would like to be able to create multiple new tabs pages and label them. This would be more useful than tabs groups that all load at once.

    No that is (currently) not possible.
    It will be possible in future Firefox version to specify the number of rows and columns.
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=752841 bug 752841] - [New Tab Page] make the number of tabs adjustable
    <i>([https://bugzilla.mozilla.org/page.cgi?id=etiquette.html please do not comment in bug reports])</i>

  • Any way to enlarge fonts etc in browser and lock them that way?

    I like safari and all, but on many sites including this one the fonts are too small for my tired eyes, so I always pinch/spread to make the text bigger. Might like to be able to increase the size of the fonts as on usually can wi a browser, but can't find it on iPad?
    Any ideas? Is it trivial and I just missed that day?

    There is no fix with MobileSafari because it doesn't let you apply your own font sizes. Well-designed web sites should have mobile options and/or font size options from within the site. Some sites just release custom apps that only surf their site with appropriate font sizes. Unfortunately, the Jive software that Apple uses for Apple Discussions has none of those.

Maybe you are looking for

  • How to upload images to a Facebook page using the export module

    I'm trying to set up the export module for Facebook so I can upload my images. It works, but I want to upload them to a Page that I've created for my professional stuff not my personal account. Anyone have any ideas? Thanks Program: Bridge CS6 Platfo

  • Page Viewer is blank in IE

    Hi! I've made an extenal website that I'm presenting in the SharePoint page viewer. The external site is hosted on Google Drive and everything works perfectly fine in Chrome and firefox but it's completely blank in IE. I cannot find a reson for this

  • HT4805 Mac mini server startup

    I purchased a used Mac mini server and can get past the startup screen for the setup process. There is a little spinning wheel in the lower left hand corner of the initial server setup screen. Anyone see this before?

  • Create button to clear/reset graph's displayed data

    Hello, I'm new here and working with labview. I've searched the forum but didn't found a answer that could help me (or at least I think thank) I'm working on a project to acquire process an ECG signal with a DAQ. In the front panel, I'm trying to dis

  • Color shift

    I have Lightroom 2, I upload files as DNG files, edit in Lightroom, then export to ProShow Producer as Jpg files. The files that open look like DNG unedited files, very dull and flat.  I expect some color shift but this is very bad.  I need to ed it