Unable to understand about the NVL

i want to know the space used by the following column , it may be possible that one of these column will bw null, for taht purpose i m using NVL , but i m unable to understand that where i will put null, to get the exact space
i have three queries here , let me know which will give me correct result ,because all these three queries gives me different result
select (
nvl(sum(length(mis_skill_lookup)),0) +
nvl(sum(length(mis_skill_selected)),0) +
nvl(sum(length(mis_place_selected)),0) +
nvl(sum(length(mis_agent_selected)),0) +
nvl(sum(length(mis_dblookup_checkpoint)),0) +
nvl(sum(length(mis_call_duration)),0) +
nvl(sum(length(mis_survey_result)),0) +
nvl(sum(length(mis_survey_id)),0)
     / 1024) / 1024 a
from mis_data where mis_dblookup_checkpoint <> 0 and mis_call_duration <> 0;
in the second and third query i have put nvl only in one column , just for an example, i will latter on put it into all the column
select ((sum(length(mis_skill_lookup)) +
sum(length(mis_skill_selected)) +
sum(length(mis_place_selected)) +
sum(length(mis_agent_selected)) +
sum(length(mis_dblookup_checkpoint)) +
sum(length(mis_call_duration)) +
sum (length (nvl(mis_survey_result,0))) +
sum(length(mis_survey_id))) / 1024) / 1024 a
from mis_data where mis_dblookup_checkpoint <> 0 and mis_call_duration <> 0;
select ((sum(length(mis_skill_lookup)) +
sum(length(mis_skill_selected)) +
sum(length(mis_place_selected)) +
sum(length(mis_agent_selected)) +
sum(length(mis_dblookup_checkpoint)) +
sum(length(mis_call_duration)) +
nvl(sum(nvl(length('||mis_survey_result||'),0)),0) +
sum(length(mis_survey_id))) / 1024) / 1024 a
from mis_data where mis_dblookup_checkpoint <> 0 and mis_call_duration <> 0;

Hi,
assuming all your columns have datatype varchar2 none
of your select statements will give you a correct
result. You will have to put NVL inside the SUM, so
the statements are reading:
sum ( length ( nvl ( <column_name>, 0 ) ) )
then you will get the right result.
Regards Markus ... btw: please change your username
to something human readableThis will never give correct answer
use
sum ( nvl( length( <column_name> ),0 ) )
eg:
sql>select * from test;
STR 

     --null here  
     ---null here

sql>
select sum(length(nvl(str,0))) sm1,sum(nvl(length(str),0)) sm2,nvl(sum(length(str)),0) sm3
from test;
SM1 SM2 SM3 
4  2  2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • In an inbuild example of can .. that CAN transmit periodic vi .. i am unable to understand how the extended and standard frame is set?

    In an inbuild example of can .. that CAN transmit  periodic vi .. i am unable to understand how the extended and standard frame is set?
    plz help me .. stuck up very badly
    thanks
    mahadev
    Solved!
    Go to Solution.

    I suggest this KB which explains usage of Ext IDs with NI-CAN
    http://digital.ni.com/public.nsf/allkb/2FA120A37EDBC51D86256854004FB0C7

  • I don't understand about the supposed new "Google Bar." Is it just for "Chrome? Where does a person get it? Thanks Robyn

    I don't understand about the supposed new "Google Bar."
    Is it just for "Chrome? Where does a person get it?
    Thanks
    Robyn

    Hi,
    It is not a browser feature, but a feature of the Google sites like Google Search, Google Maps and services like gmail. Depending on the site / service you may see it when signed in or even otherwise. It appears as a horizontal bar at the top on google related sites as of now.
    Useful links:
    [https://support.mozilla.com/en-US/kb/Options%20window All about Tools > Options]
    [http://kb.mozillazine.org/About:config Going beyond Tools > Options - about:config]
    [http://kb.mozillazine.org/About:config_entries about:config Entries]
    [https://support.mozilla.com/en-US/kb/Page%20Info%20window Page Info] Tools (Alt + T) > Page Info, Right-click > View Page Info
    [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard Shortcuts]
    [https://support.mozilla.com/en-US/kb/Viewing%20video%20in%20Firefox%20without%20a%20plugin Viewing Video without Plugins]
    [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder & Files]
    [https://developer.mozilla.org/en/Command_Line_Options#Browser Firefox Commands]
    [https://support.mozilla.com/en-US/kb/Basic%20Troubleshooting Basic Troubleshooting]
    [https://support.mozilla.com/en-US/kb/common-questions-after-upgrading-firefox-36 After Upgrading]
    [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins Troubleshooting Plugins]
    [http://kb.mozillazine.org/Testing_plugins Testing Plugins]

  • Just to understand about the 8gb 3rd generation

    I did update to version 4 tonight .. and realized there's no multitasking or other features that Apple is marketing .. Can't deny I'm really disappointed to know that I can't get those features to work on a hardware that is not even 6 months old .. even better .. something that is still on sale as the 8Gb 3rd generation ..
    When iOS4 was introduced they said 3rd generations iPods would work with it .. now u really need to go and read the fine print ... and discover that it's only for 32 and 64 GB ...
    Fine print is never a good thing ...

    Fair enough .. but a couple of things .. National dealers like Best Buy even today .. and you can verify that on their web site are referring to iPod touch 8 Gb as 3rd generation .. so I think Apple need to step up and force them not to use that marketing statement ... Apple is talking about 3rd generation on their web site .. than have a note at the bottom saying (32 and 64 Gb) ... the 2nd generation is mentioned as Late 2008 ... I got my iPod in 2010 ... so technically is nowhere to be found ...
    And I'm talking about all the not tech people going to buy an iPod now and discover after it will never get the features Apple is marketing so much ..
    Now .. do you think people will get ******?

  • Unable to know about the caps lock key in ubuntu

    hi, i have thinkpad edge 14 and have installed ubuntu 10.10 on it ,but can't get the display property which shows whether the Caps lock key is on or off. Is there such feature ?thanks

    epretorious wrote:
    Any idea how to display the status of the CAPS LOCK key on Debian? (i.e., The LOCK-KEYS-APPLET isn't in the Debian repositories.)
    CORRECTION: The LOCK-KEYS-APPLET is in the Debian Squeeze repositories but is not in the Debian Wheezy repositories.
    Eric Pretorious
    Truckee, CA

  • A few questions about the FCE interface

    I'm new at FCE, but I've done video editing for a few years in Windows (Vegas Movie Studio mostly, it was pretty good but limited in the number of video and audio tracks). I've finally made the jump to Mac and I'm excited getting started. The ability to do keyframes and motion is outstanding and I can't wait to play with LiveType and Soundtrack.
    There's a few things I'm not sure I understand about the FCE interface. I'm working on my first project and it's going to me mostly made up of short (4-10 second) video clips and still photos (with pan and zoom and some motion) and background music. I've done several of these in the past in other software, this project is my learning one for FCE.
    However, I can't understand why some things happen they way they do. If I drag a clip or still from the bin to somewhere in the middle of my existing sequence where there are no items on the video track, it 'parts the seas', moving all video on all tracks to the right and cuts my audio track wide open leaving a huge gap to make room for the clip or still even if it has no audio. The same thing happens in reverse if I'm deleting a still or clip, it chops it out and scoots everything over. I think I want to manage my own gaps rather than FCE trying to manage it for me. Does this have something to do with ripple editing - something that I must not have learned in my Windows video editing experience?
    I've ordered a few tutorial books based on recommendations in this forum, they're on their way. I didn't expect to be immediately proficient, but it seems I'm not understanding something fundamental about the interface.
    There's other questions too, like when I move a video clip from one track to another (up or down, not left or right), why does it move the audio portion of that clip to another audio track? Sometimes it stomps on something I already had on that track. Can't I unlink those somehow?
    When I bring two clips or stills together and attempt to overlap them (which I think should mean I'm doing some type of transition), it seems to just truncate one or the other. I suppose I just need to get used to that?
    Thanks for any suggestions you may have.
    iMac 20" intel   Mac OS X (10.4.10)  

    You need to get comfortable with targeting your tracks and, as mentioned, locking off tracks you don't want to affect.
    You say you want to add a clip/still to the "middle" of a sequence ... I take it there are clips to either side of this spot that you don't want to affect. Then I would set In and Out (I and O) points in the timeline to define the space you want the clip to occupy. If you don't want audio to carry over, then lock off whatever audio tracks you have edited. Then do an Overwrite by either dragging the clip to the far right of the screen to get the Overwrite pop up or by using the F10 key.
    The Delete key to the right of your keyboard (sometimes under the help key) does a ripple delete. The Delete key under the number keys (sometimes a backspace key) removes a highlighted portion of video without rippling the timeline.
    If you lay in a new clip with audio and don't want to affect an existing track, target a separate set .. so if you have a clip on V1 with its audio on A1/A2 and you want to overwrite the video but add new audio, target V1 and A3/A4.
    As to overlapping clips .. if you want to use transitions, overwrite your first clip. Overwrite the second right up against it .. don't try to overlap. Now select your transition and drop it down between the two clips. NOTE: FCE needs handles ... like about a spare 15 frames of info on both clips
    I strongly reccomend Tom Wolsky's book on FCE. It has tutorials and is a great way to start. I've never used Vegas but FCE is a very deep program ... it takes time, practise and patience (and you online manual is a great resource too)

  • Questions about the wwsbr_api.add_item

    Hi,
    I want to add an item with customize item type by pdk. It looks like wwsbr_api.add_item can do it. However, I don't understand about the p_attribute_id , p_attribute_caid in wwsbr_api.add_item. I want to make sure whether the add_item function can add a custom type item. And how.
    Thanks a lot

    Yes, the api in question can publish the custom item type. Refer to the PLSQL API documentation here
    http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1014/index.html
    Note that a custom item may have custom attributes as well that can be defined separately. For example I can create a custom attribute named "Reviewee" which is of form text, in the shared pagegroup. Then I can create item type named "Analysis Report" which uses the "Reviewee". Now when I create an item of type "AnalysisReport" I may need to supply the value for the "Reviewee"
    The parameters you mentioned are the arrays of ids and pagegroup ids for these custom attributes . You can guess now that there would some parameters to supply the values for the custom attributes; and these are "p_attribute_data_type" and "p_attribute_value"
    The other parameter of interest to you are "p_type_id" and "p_type_caid" which are the identification parameters for the item type you'll be using.

  • Trying to install/format an INTERNAL hard drive using Disk Utility gives me "Error: -69760: Unable to write to the last block of the device".   Is that a hardware problem and what could be done about it?

    *** PLEASE NOTE*** - This is a query about an INTERNAL HDD not an external one. Thanks.
    My Mac is a late 2009 model and the current hard drive recently failed. So I bought a new one, exactly the same, albeit 750gb instead of 500gb. The HDD is a Seagate Momentus 7200. Before the my current drive failed I made a time machine back up to an external USB HDD. I've inserted the HDD into the bottom of my Mac, plugged in the USB and started my machine pressing the 'Option' ([ALT]) key. I go into Disk Utility to try and format the new HDD by creating a new partition but I keep getting the messages,
    "Error: -69760: Unable to write to the last block of the device"
    or
    "POSIX: could not allocate memory"
    This is actaully the third HDD I've tried. The first was another Seagate Momentus 7200 500gb, but this time it was a newer model (model number ended in 423AS instead of 420AS - the new one I am trying ends with 420AS, which is the same as the current HDD). I then tried a Western Digital drive but that one didn't even show up in DU. Forums and tech support are suggesting it's faults with the HDDs but surely not three in a row?
    Could this be an issue with another part of my Mac?
    Is there anything else I can do to format the HDD, have I missed a crucial step?

    Did you ever get a resolution to this issue?
    I am having that exact error with a new 512GB SSD from Crucial, in a 15" MBP mid-2010.
    I really wonder now if the stupid SATA cable could be bad - causing the initial SSD fail.  I am replacing it with the EXACT same drive, and getting that "last block" error when i partition in the GUI or from command-line.
    thanks!

  • This sign appeared in my account: "Your payment method was declined. Update your biiling info'. After adding new information about my others cards I see the same sign. Can't understand what the problem is and what should I do. Need help!!!

    This sign appeared in my account: "Your payment method was declined. Update your biiling info'. After adding new information about my others cards I see the same sign. Can't understand what the problem is and what should I do. Everything used to be good before.
    Do anyone know what I supposed to do in that situation?
    Really need help!
    Thanks in advance.

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Unable to understand the usage of OAFM and OACORE run in OC4J in Release 12

    I have gather below details but still unable to understand that why two services are there in OC4J in Release 12. My questions are:
    [1] If OACORE is there and most of the components are based on Framework in Release 12 then what is the requirement of OAFM?
    [2] Is OAFM is only for mapviewer, ascontrol and "Oracle Transport Agent" if we use them?
    [3] Why there is seperate process for HTTP_Server as given below if OACORE is already there.
    I have gathered below details from various source but still unable to understand fully above three questions.
    * Oacore: This runs the OA Framework -based applications (Core Application Modules).
    * Forms: This runs the Forms-based applications (using Servlet Mode).
    * OAFM (Oracle Apps Fusion Middleware): This is responsible for running the web services , mapviewer, ascontrol (Oracle Transport Agent).
    [oratrain@ndaeasdb01 scripts]$ ./adopmnctl.sh status
    You are running adopmnctl.sh version 120.4
    Checking status of OPMN managed processes...
    Processes in Instance: TRAIN_ndaeasdb01.ndaeasdb01.xone.xansa.com
    ------------------------------------------------+---------
    ias-component | process-type | pid | status
    ------------------------------------------------+---------
    OC4J | oafm | 19974 | Alive
    OC4J | forms | 19888 | Alive
    OC4J | oacore | 19768 | Alive
    HTTP_Server | HTTP_Server | 19711 | Alive
    Web Entry Point Services          HTTP Server
    Web Application Services          OACORE OC4J
                        Forms OC4J
                        OAFM OC4J

    Let me chk the complete details on a R12 server. but for the time being, all I can say is that there are different HTTP services for the R12 Apps and the SOA suite components.
    Also your DBA might be a better person to answer and even some reading in the Oracle Process Manager Dev guide, Admin guide will help.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Unable to understand the concept of Indexing

    Hi,
    I searched for indexing.I only understood that it is used for performance tuning.Means a indexed query will run faster ,as compared to other query that is not indexed .But i did'nt understand how it is working .It seems i have known nothing about Oracle Index. Any idea?

    user12222356 wrote:
    Suppose i have a small table, with two or three columns, and a few data inserted into it. Then suppose i create an index on any column, what effect will be seen here ? Correlating with books index , we are intelligent enough to understand what we are searching for .we see related topic and go to that page.Note related topic.Even we did'nt find actual topic we try to find related topics.
    As for oracle tables,each columns have values, and storing info about each column will generate anther table(as i think).So two table now.So will both the tables now be queered?Such a small table can be compared with a book that has only half a page with text. You don't need any index for that book. It is faster simply to read the whole book (it is only half a page long!). In database terms this would be a full table scan (FTS).
    You need an index if the book is 100 pages thick. Usually most books will have several indexes. One at the start that tells you about the differnt chapters. And a glossary at the end, where you can look up certain keywords and you also get to know on wich page those keywords had been mentions.
    Lets say you have a book about animals in Africa.
    So when you search for a certain keyword you have two options. You keyword would be rhino.
    FTS (Full table scan)
    Either read the whole book from page 1 turning to page 2 and so on until you find the keyword. And if you find it you have to read on, because maybe the keyword is mentioned again at the very last page. You need to read the whole book.
    You will find some parts about white and some parts about black rhinos.
    Or
    Index access
    You go to the glossary and search for the rhino keyword there.
    Since the glossary is ordered you'll find it very fast. You will also know that you don't have to read the full glossary because it is sorted alphabetically. You then go to the page in the book (=ROWID of the table) where you find the keyword. If the glossary mentioned several pages, then you need go to all of the pages to get the full picture.
    it will even more efficient if you search for a keyword like "tiger". Since a tiger does not live in Africa you would need to read the whole book just to find out that there is no "tiger"-content inside. If you use the glossary then you can fast scan the two glossary pages to see that nothing about "tiger" inside.
    So an index is very efficient in telling you where to find something, but sometimes also in telling you what you will not find.
    Edited by: Sven W. on Jul 13, 2010 11:12 AM

  • Hello, im unable to makean icloud account on my iphone, because whenever i make an account a messege appears that this device has enough account so you can not make new account, and the problem is that i dont konw about the perevious account, so what shou

    hello, im unable to make an icloud account on my iphone, because whenever i make an account, a messege appears that this device has enough accounts so you can not make a new one, so the problem is that i dont konw about the perevious accounts, what should i do to delete pervious accounts and create a new one?

    The problem is that there is a limit for creating new iCloud accounts from a device and if the previous owner already created three accounts with this iPhone you bought from him, then you would have to use another device in order to create a new one.

  • Got a MacBook with 10.5.8  I am anable to burn cds, dvds, and dl dvds.  Everything worked before I reformatted my computer but now it comes up with error messages like unable to communicate or something about the laser power levels.  Help! Anyway to check

    Got a MacBook with 10.5.8  I am anable to burn cds, dvds, and dl dvds.  Everything worked before I reformatted my computer but now it comes up with error messages like unable to communicate or something about the laser power levels.  Help! Anyway to check to see what is going on?

    Hi I am having the identical problem with my 24" intel iMac 2007..... Did you ever figure out what the problem was? I'm on round 3 now and with a completely blank grey screen and it won't start up from the disk 1.. I also have diskwarrior and techtool pro as well as the osx leopard and snow leopard disk... The HD is new.. Replaced by apple 3 months ago.. Don't know the cause the first time this happened about 9 months ago.. 2nd time, 6 months ago it never rebooted from the office for mac 2008 critical update... Did a clean install after backing up to TC... Took it to apple replaced HD even though it appeared ok, they checked all hardware and I ran techtool pro daily ever since. Last week software update had several updates avail. Office for mac being one of them.. I updated and have never booted since.. . I swear to never ever use another Microsoft product as long as I live if I can just fix this once more... Help me please

  • I am unable to play a downloaded HD movie from iTunes. SD movies play OK. An error popped up saying something about the display not suitable for HD movies but now all I get is a blank window. I have tried changing the display resolution to no avail.

    I have sownloaded an HD movie from iTunes store and when I attempted to play it on my Windows 7 PC a error message popped up saying something about the display not being compatible for HD movies. I have tried changing the display resolution several times but it didn't help. Now it just comes up with a blank screen when I attempt to play it. SD movies work fine. I have the latest version of iTunes installed.
    Can anyone help me resolve this problem?

    Apparently the display is required to be HDCP compatible to view HD movies in iTunes. My display isn't so this is my problem. I contacted Apple support and they have agreed to credit me for the HD movie and I have now downloaded the SD version.

  • Null . Unable to understand the null value concept

    Dear friends, I am very confusied about the behavior of ----"null"
    and i take a String.The String value will come from data base ---- String inputString[This string value will come from database], In data base the value is null.
    now i am checking if the string "inputString" is null --will perform a work  if not then perform another work.
    so--
    inputStringFromUser.equals(null)
    System.out.println("In if block");
    else
    System.out.println("In else block");
    but it not working if the data base field is blank.
    but if i do ---
    inputStringFromUser==null)
    System.out.println("In if block");
    else
    System.out.println("In else block");
    it is working fine . why???
    please tell me why it is happning.

    I did not get any null pointer exception when i test
    if(inputStringFromUser.equals(null)
    y previous query have cleared.
    But i fell i am little bit of confused for this ---
    "can't invoke methods on a null reference, that gives
    NullPointerException".Can any one please explain.Here's the deal and here's what they're trying to say without any metaphors...
    inputStringFromUser is a String object right? the equals method is inherited from the Object object (java.lang.Object)
    but if inputStringFromUser is null, it means there's no instance of that String object...so if it's null you cannot access the equals method...this is why you need to use the == operator to see if it's null.
    hope that makes sense.

Maybe you are looking for

  • How to find out the application server instance name?

    Hi, I installed an Oracle application server a long long while ago and completely forgot the things about the installation, including the name of the instance (I installed single instance, not cluster). Now I am trying to create a connection to the a

  • Cancel or credit memo biling document

    hello ,everyone,    as we all know that ,we can cancel the billing decument ,which result a document type s1,and we also can create credit memo with reference to the billing document, now I want to realise this funciton: as to the billing document of

  • Variable Code for Date

    Requirement: I have Posting Date for all Objects Now i want to create the <b>Variable “PSTVAR”</b>such that the variable will populate <b>only the entries with User Input Posting Date(During Report Execution) >=greater than equal to Posting Date(OPST

  • House banking, manual cheque lot creation,

    hello, house banking, manual cheque lot creation, the first feild to enter is payment document number, from where we get that payment document number, just entered the payment posting number, but count not save ,

  • Is there any t-code in which the List of Customers Display?

    Hi SDN, Is there any t-code in which the List of Customers Display? Like the MKVZ, this is the t-code for List of Vendors Display. Thanks, Sumit.