Diff between decode and case

Hi
I need small clarification about difference between decode and case
Thanks who visit my thread

And for those people who can't be ar$ed to follow links...
Decode allows for conditional output where the conditions are straightforward matches between values.
Case allows for regular conditions to be used such as greater than, less than etc.
Some of the things done by case can be achieved through decode as well but in a more convoluted manner than simply using case.
;)

Similar Messages

  • What is better and fast to use between decode and case

    Hi friends,
    i wanted to know what is better to use decode or case in sql,which gives faster result.
    thks
    sonal....

    Here's a very simple timing comparison. This table (actually it's a partition) has a little over 1 million rows.
    As you can see, the timing difference is trivial. (I ran an earlier query to fetch the blocks from disk).
    SQL> select sum(decode(balloon_flag
      2                   ,'Y',1
      3                   ,0
      4                   )
      5            ) bal_count
      6  from   prod.loan_master
      7  where  report_date = to_date('31-DEC-2005');
               BAL_COUNT
                    9036
    Elapsed: 00:00:07.65
    SQL> select sum(case balloon_flag
      2                  when 'Y' then 1
      3                  else  0
      4             end
      5            ) bal_count
      6  from   prod.loan_master
      7  where  report_date = to_date('31-DEC-2005');
               BAL_COUNT
                    9036
    Elapsed: 00:00:07.68
    SQL> select sum(case
      2                  when balloon_flag = 'Y' then 1
      3                  else  0
      4             end
      5            ) bal_count
      6  from   prod.loan_master
      7  where  report_date = to_date('31-DEC-2005');
               BAL_COUNT
                    9036
    Elapsed: 00:00:07.46

  • Decode and Case

    Hi,
    What is the difference between decode and case?
    What are the cases in which we can use Decode and case
    Thanx

    you can not put Search CASE statements by using DECODE
    Eg:
    SELECT AVG(CASE WHEN e.salary > 2000 THEN e.salary ELSE 2000 END) "Average Salary" FROM employees e;Can't we?
    select avg(decode(sign(e.salary - 2000), 1, e.salary, 2000)) "Average Salary" from employees e;

  • Diff between issession and issystem

    All,
    Wanted to understand ..When we need to restart he DB servers in case if we change some parameters ...?
    What is the diff between issession and issystem modifiable clauses ...?
    Thanks

    Got the answer

  • Diff between cusztmizing and workbench request

    could u please let me know what is diff between workbench and custmizing req ?
    Regards

    Hello,
    customizing req vs workbench request
    Check this info.
    Workbench Requests
    When you change a Repository object of the ABAP Workbench, a query window appears in which you need to specify a Workbench request. You can only save the changes if you have assigned the object to a change request.
    Workbench requests and the tasks assigned to them are normally used to record changes to Repository objects and Customizing for all clients. However, you can also include client-specific Customizing.
    Whether the changes to Repository objects are transported depends on whether a transport route is defined from the current SAP System for the package of these objects. From the system settings, the system automatically determines whether the change requests are transportable and to which target system they should be transported.
    Customizing requests
    Customizing requests record client-specific Customizing settings made in a single client (the source client of the request).
    Automatic recording of configuration activities in the Customizing work for a client can be activated or deactivated for each client with Client Control. If automatic recording is active, a query window appears when you change Customizing settings, asking you to specify a Customizing request.
    Whether Customizing requests are transported or not, does not depend on the objects entered, as is the case with Workbench change requests. The Customizing requests in an SAP System (or in a client if you use Extended Transport Control) are either all transportable or all local, depending on the system setting. The system uses the standard transport layer to determine automatically whether the change requests are transportable and to which target system they should be transported. However, you can change this manually.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards,
    Jorge Diogo

  • DIFF BETWEEN ABSOLUTE AND PERCENTAG TOLERANCE LIMITS

    Gud morning Gurus
    Can anyone tell me what is the exact difference between Absolute & Percentange tolerance limits in invoices that we set in customizing.
    it wud be better if any example is given.
    Thanks

    I WENT THRU THE URL SUGGESTED BY YOU.
    BUT I WANT TO KNOW IN WHAT CASES EXACTLY THE SYSTEM CONSIDERS ABSOLUTE AND PERCENTAGE LIMITS.
    ACTUALLY I READ A STATEMENT THAT THERE IS A DIFF BETWEEN ABSOLUTE AND PERCENTAGE LIMITS, SO WHAT IS IT?
    IN QUANTITY VARIANCES,AMOUNT VALRIANCES ETC.
    . Quantity variance: For a purchase order, the open quantity to invoice is a result of the delivered quantity and the quantity already invoiced. There is a quantity variance if the invoice quantity does not match this open quantity. At the absolute upper limit, the quantity variance is evaluated on the basis of the amount in the invoice item. This means that invoice items with a small amount result in a relatively large quantity variance, and that invoice items with a large amount result in a small variance. You can also define percentage limits for the quantity variance check, for which the system does not take account of the purchase order price.
    WHAT DOES THE ABOVE STATEMENT EXACTLY MEAN?CAN U EXPLAIN UDAY...
    THANKS
    Edited by: sapppfresher on Oct 3, 2011 6:56 AM

  • Diff between Serialization and Synchronization

    Hi I am new to java.
    Pl. give me the difference between Serialization and Synchronization.
    Thankq
    Sridhar

    Don't you look at the timestamps of posts? They could
    have been typing at the same time.
    /KajPlease stop! I'll die laughing. LOL
    Re: Diff between Serialization and Synchronization
    Author: Annie.   Apr 11, 2005 10:30 AM (reply 1 of 4)  
    Re: Diff between Serialization and Synchronization
    Author: glrao   Apr 12, 2005 8:31 AM (reply 2 of 4) I really like your sense of humor.
    xH4x0r

  • Types of  DTP , Diff between Standard and Error DTP

    Hi experts,
    What is DTP ,  are the Types of  DTP , Diff between Standard and Error DTP , how it works in BI 7.0.
    I will assign points for your valuable answers.

    Hello ,
    Data transfer process (DTP) to transfer data within BI from one persistent object to another object, in accordance with certain transformations and filters. In this respect, it replaces the data mart interface and the InfoPackage. As of SAP NetWeaver 7.0, the InfoPackage only loads data to the entry layer of BI (PSA).
    The data transfer process makes the transfer processes in the data warehousing layer more transparent. Optimized parallel processing improves the performance of the transfer process (the data transfer process determines the processing mode). You can use the data transfer process to separate delta processes for different targets and you can use filter options between the persistent objects on various levels. For example, you can use filters between a DataStore object and an InfoCube.
    Data transfer processes are used for standard data transfer, for real-time data acquisition, and for accessing data directly.
    1.Benefit: Data ‘Distribution’within BI Capabilities (from PSA or InfoProviders to InfoProviders)
    2.Improved transparency of staging processes across data warehouselayers (PSA, DWH layer, ODS layer, Architected Data Marts)
    3.Improved performance and high scalability
    4.Separation of delta mechanism for different data targets: delta capability is controlledby the DTP
    5.Enhanced filtering in dataflow
    6.Repair modus based on temporary buffers (buffers keep complete set of data)
    See these docs for more info
    [Data Transfer Process |http://help.sap.com/saphelp_nw04s/helpdata/en/42/f98e07cc483255e10000000a1553f7/content.htm]
    [Enterprise Data Warehouse (EDW)|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/67efb9bb-0601-0010-f7a2-b582e94bcf8a]
    [What's New with SAP NetWeaver 2004s - Detailed|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/910aa7a7-0b01-0010-97a5-f28be23697d3]
    [SAP NetWeaver 7.0 ETL and EII|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0b24053-654e-2a10-4180-b0e7c7b4c9f2]
    [How to Create Monitor Entries from a Transformation Routine (NW7.0)|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50fda171-e36e-2910-9290-e3dab26c50b5]
    FAQ on SAP NetWeaver 2004s
    [Modeling the Enterprise Data Warehousing for SAP NetWeaver 2004s FAQ|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7c2a7c65-0901-0010-5e8c-be0ad9c05a31]
    [Enterprise Data Warehousing for SAP NetWeaver 2004s FAQ|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c9f5fb91-0c01-0010-67a8-fd35946e9403]
    Thanks
    Chandran

  • Diff between dbms_profiler and dbms_trace

    Hi,
    what would be the major diff between dbms_profiler and dbms_trace? which is more useful.
    Thanks,
    Mathew

    DBMS_PROFILER is one way to analyse where the time is being spent

  • Whats the diff between express and pro??

    Just wondering what the main diff between the two are. I've used pro at school, but cant afford to get it at home. Will i still be able to use the same audio instruments like the same synths and plug ins??? Also, would i be able to run the program on a mac mini (top of the line)?

    Matt Mac 63, "Whats the diff between express and pro??" #5, 10:33pm Oct 18, 2005 CDT
    All I was saying is that if a person can afford to get Pro, they definitely should. The difference in features adds up to at least the difference in price, if not very much more.
    Having said that, Express is good value compared to most other DAW software at that pricepoint, but it is only intended as a 'Lite' version.
    Some examples, off the top of my head, of differences not made really clear in the comparison list.
    Input Objects:
    In Pro you can use Input Objects to monitor incoming signal without rec-enabling a track. That doesn't sound much, on the face of it, but what it means is you can use external FX units (hardware) as inserts in tracks (or busses) just like plugins, and bounce them with the mix. it also means you acn monitor what you are playing into Logic Pro with plugin FX applied, but record dry so you can hear your guitar with the reverb, or whatever, but still have the recorded dry signal so you can change the FX settings later.
    Pro has some very handy environment objects. The main one being the Trabsformer object. But also another extremely useful object is TouchTracks.
    If you've ever played with Ableton Live you would have noticed you can triger clips with the keyboard in all different ways (loop, gate loop, one shot etc.) Well TouchTracks does that with MIDI regions.(I have a feeling that feature in Live was modeled after Logic's TouchTracks' as it is incredibly similar.)
    They are only a few examples of a whole range of differences. If all the differences were itemized in the 'comparison chart' it would be about 3 pages long.
    All I am saying is, don't take the comparison chart as the definitive list of differences.
    yes, Express is a good basic tool and you can do a lot with it, with some imagination.
    The SOS author's claim that:
    you're paying less than a third of the price of Logic Pro and getting over 90 percent of the functionality."
    is not true in totality.
    It may be true to someone who has never dabbled in audio software before, because it takes literally years to become fully conversant with every function in Logic Pro, and no-one uses absolutely everything.
    But for serious users, who have big demands, in my opinion, Express is less than 30% of Pro's functionality.

  • How does decode and case works?

    Hi,
    I want to know how decode and case works? How they process the arguements. Please explain me with some examples.
    Thanks,
    Sarav
    Edited by: 943941 on Jul 3, 2012 1:42 AM

    welcome
    check this link
    https://forums.oracle.com/forums/ann.jspa?annID=1535
    you will find everything you need
    DECODE compares expr to each search value one by one. If expr is equal to a search, then Oracle Database returns the corresponding result. If no match is found, then Oracle returns default. If default is omitted, then Oracle returns null.
    This example decodes the value warehouse_id. If warehouse_id is 1, then the function returns 'Southlake'; if warehouse_id is 2, then it returns 'San Francisco'; and so forth. If warehouse_id is not 1, 2, 3, or 4, then the function returns 'Non domestic'.
    SELECT product_id,
           DECODE (warehouse_id, 1, 'Southlake',
                                 2, 'San Francisco',
                                 3, 'New Jersey',
                                 4, 'Seattle',
                                    'Non domestic')
           "Location of inventory" FROM inventories
           WHERE product_id < 1775;Edited by: user 007 on Jul 3, 2012 2:40 PM

  • Diff Between PCC and PC by Order

    Dear Team,
    Why PCC does not support Actual Cost Method and Why PC by Order does't not support Target Cost Method?
    Please give your views and comments.
    Best Regards,
    Satish

    hi
    =========================
    what is diff between billing and invoice?
    From the help for cash order, it says that the invoice will print immediately after order created, the billing will be done seperately by transaction after delivery. Can anyone explain more detail.
    =================
    based on ur query.. Billing and Invoice are one and the same.. the difference is that in general business terminology Billing means the process of crediting the customer to the certain sum of money either by cash or credit, for the goods or services purchased by him... this process consists of many other documents like credit note, debit note, invoice, etc. 
    Invoice is the Printed format of the Bill ie, the sum of amount the customer is credited is made available in the printiable format....
    dont get confused by the Billing and Invoice words.. in simple way invoice is one of the documents generated during the billing process.. Billing is a process which consists of various different documents which are generated depending on the business requirements...
    Reward if USeful
    Thanx & regards.
    Naren..

  • Diff Between Interfaces and API

    Hi to all.
    Can anybody tell me , What is the basic diff between API and Interfaces ?
    Thanks in advance

    Hi Lalit,
    Both place validation will happen. In Interface table as well as in API.
    The difference you can say..for interface you have to load the data in and invoke the import program by which it will populate data in oracle apps base table. So you have to write some DML.
    While in API you can simply use PLSQL record type and using that invoke API by which it will populate record in oracle apps base table.
    Keep in mind both ways the validation happens. It is just the approach and some part is just for legacy data conversion.
    Regards
    Prashant Pathak

  • Diff between ides and original package

    can any one tell me what are main diff between ides and original package
    thanks
    with regards,
    phani

    HI.,
                  IDES saytem is like a play ground in which we do all the transcations,But in Real time systme we dont have as many reference clients as IDES systme have,We have one reference client 0001 In real time systme as their land scape is laid as development,Testing & Production systems
              Important thing is all the screens & T.codes are sames in both
    REWARD if helpfull
    Thanks & Regards
    Narayana

  • Diff. between currency and unit fields

    Hi All,
    What is the diff. between 0DOC_CURRCY and 0CURRENCY, OUNIT and 0BASE_UOM? In which scenarios do we use each of them?
    I have a flat file which contains some values for sales and quantity but does not have any units. So I have to upload them using constant currency and unit. now, I have to create my own keyfigures for the sales and quantity. What currency and unit fields should I use i.e 0CURRENCY or 0DOC_CURRCY and OUNIT or 0BASE_UOM?
    Thanks a lot,
    James.

    hi James,
    0doc_currency, 0currency share the same master data->0currency, 0unit, 0base_uom share the same master data->0unit, the 'basic' infoobject is 0currency and 0unit, all currency and unit will have reference to these infoobjects.
    currency is used for keyfigures amount, with currency e.g usd, gbp, etc.
    unit for keyfigures quantity, with unit like KG, CM etc.
    currency tables are TCUR* and unit table T006*
    you can use any of these infoobject currency or unit in your keyfigure (RSD2) or fix value like USD etc, normaly 0doc_currcy used for document currency; 0loc_currcy for local currency, you can create your own infoobject currency/unit with RSD3.
    hope this helps.

Maybe you are looking for

  • How do i fix screen resolution message

    Your screen resolution is set below our minimum recommendation of 1024 x 600 pixels. my screen resolution is already set at it's highest: There is a screen resolution problem Your screen resolution is set below our minimum recommendation of 1024 x 60

  • Customer Open Item clearing Line Layout (O7F4)

    Hi Dear ABAP experts, I am the FICO consultant and I got the below issue. I am trying my level best to solve this issue. But i need some help. So I am posting this issue in forum. Pl check this issue and give me ur valuable suggestion. the user uses

  • Z30 followup...

    Well...it's been a week that I've been with my first BB...the Z30...and I have a few things to say... Being with a Droid for the past two years...I took the plunge...with concern...to something I thought would be a more productive phone for me...and

  • Im working with 13 psd images in Motion right now and its incredibly slow!

    every little thing Im doing is beach balling and its incredibly frustrating. What can I do in my settings to optimize Motion's performance? Im just creating a simple camera move through my images but its almost impossible with the speed its currently

  • Error installing Oracle Enterprise Manager Grid Control 10g Release 2

    Database version: 10.1.0.5.0 with CPUApr2008 OS: Microsoft Windows Server 2003 R2 I'm installing R2 so I can then install R4. I get an error towards the end of the installation when it runs through the OMS Configuration. I get the following error: Co