Logic for this requirement

Hi friends,
I get salary from different tables... like for example
m_sal and e_sal..if the salary is null in m_sal i have to select salary from e_sal and viceversa
can you pls tell me how to do this
Thanks

You would still use COALESCE
SQL> with
  2  emp as
  3      (
  4      select 1 empno from dual union all
  5      select 2 empno from dual union all
  6      select 3 empno from dual union all
  7      select 4 empno from dual union all
  8      select 5 empno from dual union all
  9      select 6 empno from dual
10      ),
11  sal1 as
12      (
13      select 1 empno, 100 esal from dual union all
14      select 3 empno, 200 esal from dual union all
15      select 5 empno, 100 esal from dual union all
16      select 6 empno, 300 esal from dual
17      ),
18  sal2 as
19      (
20      select 2 empno, 600 msal from dual union all
21      select 4 empno, 500 msal from dual
22      )
23  select
24      e.empno,
25      coalesce
26          (
27              (select sal1.esal from sal1 where sal1.empno = e.empno),
28              (select sal2.msal from sal2 where sal2.empno = e.empno)
29          ) sal
30  from
31      emp e;
     EMPNO        SAL
         1        100
         2        600
         3        200
         4        500
         5        100
         6        300
6 rows selected.

Similar Messages

  • Need the Logic for this Prg issue Pls

    Hi Friends,
    i have an urgent requirement..
    i am develop the report that is :
    Based on Selction Critirea kunnr(knvv-kunnr)
    i want Delete the
             Internet mail (SMTP) address FROM ADR6-MTP_ADDR
    AND Teletex number FROM ADR4-TTX_NUMBER..
    USING TABLES ARE KNVV , ADR6 AND ADR4.
    please how to Write the LOGIC For this Program .
    help me.. it is an urgent.. anyone.
    regards,

    Hi Alchermi,
    thanks for your reply soon.
    based on selction kunnr .. i want deete the ADR4-TTX_NUMBER..and ADR6-SMTP_ADDR From these 2 tables
    for these 2 fields..
    kunnr from knvv, selection field..
    below fields want be DELETED..
    ttx-number from adr4,
    smtp_addr from adr6.
    it is an urgent. help me .
    regards,

  • Please provide the abap code for this requirement

    note : if the below mentioned user exit is not suitable please find the suitable user exit and provide the code for this requirement.
    •     The User-exit MEFLD004 is only to be used at PO level (ME21N/ME22N).
    •     When PO is create or changed (ekko-ebeln) user exit MEFLD004 is triggered which check for the business requirement of the PO check for PO doc types (ekko-bsart) :z4,z6,z11,z12 from the table ekko and Account Assignment Category (knttp) is either N or K then stock process follows.  
    •     When an PO is cancelled, all entries will have to be reversed
    •     The Buffer table for the PO will have the following fields:
    Purchase order Number                     EKKO-EBELN
    Line item number of the PO               EKPO-EBELP
    Vendor Number                                  EKKO-LIFNR
    PO Quantity                                        EKPO-MENGE
    PO Nett Price                                     EKPO-NETPR
    Base Unit of Measure                  EKPO-LMEIN
    Account Assignment Category          EKPO-KNTTP
    PO Doc type                       EKPO-BSART     
    Plant                            EKPO-WERKS     
    Purchase Org                                  EKKO-EKORG
    Purchase Group                    EKKO-EKGRP     
    Company code                                EKPO-WAERS
    Item category                     EKPO-PSTYP
    PO Doc Date                      EKKO-BEDAT
    •     No duplications are allowed for any created, changed or cancelled purchase orders. If such a case occurs, the record will be updated with the latest update time stamp. This custom table will be keyed by purchase order number.

    Cross-post: http://forum.java.sun.com/thread.jspa?threadID=763485

  • "You must specify a value for this required field" in SharePoint list

    HI All,
    I have a couple of taxonomy fields in my content type. When I try to add a new item with my content type and save, I'm getting an error message "You must specify a value for this required field" against each taxonomy field. I'm not sure what am
    I missing. I deleted the content type and added that again to my list but still no luck. Can someone please help me out? Thanks.
    Regards,
    SC Vinod

    hi
    it depends how you updated existing field. We faced with the problem that update of taxonomy site column was not propagated to the lists. In Sharepoint when content type is bound to the list, new hidden content type is created for that list - you may check
    it if will enumerate
    SPList.ContentTypes property. And when you try to update site column changes may not be propagated to these list content types. In order to update it you need to get reference on a field from list content type and update if explicitly.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • Logic for this comparision of character type operands.

    Source field name: ZDCNFG
    Target Info Objects:
    ZDVD59
    ZDVD10
    ZDVD14
    ZDVD18
    ZDVD25
    ZDVD50
    Scenario1: If ZDCNFG = 2(10). 2 is quantity and 10 in brackets is part number (DVD format). So I will have to update the quantity respective field as shown below.
    ZDVD59: 0
    ZDVD10: 2 -->updated 10 part
    ZDVD14: 0
    ZDVD18: 0
    ZDVD25: 0
    ZDVD50: 0
    Scenario2: If ZDCNFG: 2(25)3(50)
    ZDVD59: 0
    ZDVD10: 0
    ZDVD14: 0
    ZDVD18: 0
    ZDVD25: 2 --> Updated
    ZDVD50: 3 --> Updated
    Scenario3: If ZDCNFG: 2(5)3(9) ---This is exceptional case. If we have 5 and 9 then add and assign 5 to ZDVD59 rest all are 0.
    ZDVD59: 5  Sum of DVD5 and DVD9
    ZDVD10: 0
    ZDVD14: 0
    ZDVD18: 0
    ZDVD25: 0
    ZDVD50: 0
    Quantity is the value which is out side the brackets. For e.g. in 10(5), 10 is the quantity.
    Can any one give me a logic for this.
    I was trying with CA  CS etc..but no charm.
    Thanks
    Kiran

    Kiran,
    This should work
    parameters: zdcnfg(50).
    data: zdvd59(3),
    zdvd10(3),
    zdvd14(3),
    zdvd18(3),
    zdvd25(3),
    zdvd50(3),
    rcnt type i,
    roff type i,
    temp type i.
    data: static(50).
    start-of-selection.
      static = zdcnfg.
      replace all occurrences of '(5)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(5)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd59.
        enddo.
      endif.
      zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(9)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(9)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd59.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(10)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(10)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd10.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(14)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(14)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd14.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(18)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(18)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd18.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(25)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(25)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd25.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(50)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(50)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd50.
        enddo.
      endif.

  • Could you please suggest me the scenario for this requirement ?

    In module booking process we need the following process
    1.Student select their interested event package via website.
    2.Advisor review the student's event package list.
           2.1 In case of REJECT : student need to revise their list
           2.2 In case of APPROVE : all event package have confirm and run fee calculation.
    The information above is shortly requirement , if any one have suggestion for this requirement please suggest me.

    Vorad,
    I have some suggestions for you:
    1.  Create the module/event booking with 'Manual Conditional' flag.  Then, when the advisor approves a booking, remove the conditional flag.  If the advisor rejects, cancel the booking.  Here, you need to create some kind of UI for the advisor to review and approve/reject the requests.
    OR
    2.  Create the booking using a booking status such as 'pre-booked'.
    OR
    3.  Don't create any bookings from the student side.  Just create a booking plan instead.
    OR
    4. Look at a subtle process change that would let you use more out-of-the-box user interfaces/processes.  Students simply request special booking authorization for the event packages they want.  This automatically sends workflow approval messages to the advisor.  Then, just have a general rule which blocks all bookings that don't have this special authorization.   Once the student has a special booking authorization, he can just go into the course registration self-service and book the approved event packages.
    Michael

  • Logic for this senerio -- UDF

    Hi XI Gurus,
                          I hav to create a UDF.This is an IDOC - XI - FILE seerio. In  this senerio is I have an IDOc whose 7th segment contains a field. This field can store values in between 0 - 9. On the other hand I have a file structure in my left hand side from Messge mapping prespective , which contains 9 similar sized fields.
    Now the logic is if the field in the segment of the idoc has value say '3', then the file structure in the left hand side would have 3 in the field no 3 and all other fields 1, 2, 4, 5, 6, 7, 8, 9 would be zero.
    Can u guys suggest some logic for this???
    Thanks in advance !
    Poits would be rewarded.
    Arnab

    Hi Mohd,
    Select the Queue option for getting individual nodes
    public void test(String[] a,ResultList result,Container container){
    if (a<i> == 7) { //This is for selecting the node
    for(i=0;i<10;i++){  //This is for collecting the correct value
    ifIi==3){
    write what ever u have to done
    else{
    write the exceptional condition
    Dont to Reward points if this helps
    Regards
    Pragathi.

  • Pls give me the solution for this requirement

    Hi experts ,
    pls give me the solution for this requirement
    what we have to do when basis guys are tranported my object to the production without completting . how can we rectiify this .
    thanks in advance

    Hi
    After Transporting a request or released a request you cant do any thing in that so now you have to create a new Transport request for your report continue with that. After completion transport it . It will makes no difference it will just over write already existing report
    Reward alll helpfull answers
    Regards
    Pavan

  • Regarding select statement for this requirement

    Hi................
    good evening
    here is a requirement.
    i want to retrieve data from the following table.but how to join these table is my dought.
    tables  fields
    t001w--werks " plant id
    t001w--name1 " pl;ant name
    t001w--regio " plant address
    ekko--ebeln " purchase  order
    ekko-erdat : creation date
    ekko-ernam "name of the person
    ekpo-ebelp " item
    ekpo-bstyp "purchase order type
    eket-erdat " delivery date
    mara-matnr " material number
    these are the tables and fields.now we want to retrive data from these tables
    how we have to code select statement.
    selection-screen is
    plant id
    order type
    delivery date
    please provide select statement for this requirement.
    thanks and regards.
    k.swaminath  reddy.

    Is this what you are looking for?
    SQL> CREATE OR REPLACE FUNCTION f_team
      2  RETURN VARCHAR2
      3  IS
      4    s_return VARCHAR2(500);
      5  BEGIN
      6    FOR i IN ( select team from t_team order by 1) LOOP
      7      s_return := s_return || i.team || ', ';
      8    END LOOP;
      9   
    10    RETURN substr(s_return, 1, length(s_return) - 2);
    11  END;
    12  /
    Function created.
    SQL>  SELECT f_team FROM dual;
    F_TEAM
    Australia, Bangladesh, England, India, Kenya, Pakistan, South Africa, UAE, USA, West Indies, Zimbabwe
    SQL>

  • Which Hardware shud i go? For this requirement.

    Hello all,
    As per requirement, In Oracle 9i, 1000 tps(transaction per sec) requirement ( 60% insert update and 40 % search operations). Dose oracle 9i ( standard ed.) with 2 CPU machine will handle this requirement ?
    What will be performance figure on LINUX/SUN in term of tps in oracle 9i standard ed.?
    Could you all please suggest me for what hardware platform should i go and also what RAM should i use here.
    Database Size will be apporx 10G
    Thanks in Advance!!
    Its urgent please....
    Pankaj

    We have no idea what your hardware will be or whether these will be long running or short transactions or whatever.
    Your question is not easy to answer; the only way of getting a definitive answer is to test your workload over a period of time.
    For this there are tools which will load a system up : for example Hammer Ora or Swingbench are both freely available.

  • BPM or Java/Db for this requirement

    Hi,
    Here's the requirement: A user creates a document (using webcenter portal UI) and he has a provision to add 'n' number of reviewers both sequential and parallel reviews are needed and also a combination is needed, which the user will add through the UI page.
    The requiment also states that the user should be able to modify the review steps. Suppose A has reivewed and B is yet to review, he should be able to replace B with C or even delete his review. Bottomline is that, the client needs a free hand to manage document review/approval as we deal with physical docs.
    The documents will be stored in Oracle UCM and I am using JSR 286 portlets for the UI.
    Is BPM a right thing to use here? can I dynamically build/query update BPM processes? OR shall I use java with Db to achieve this. The later gives me more control and developers are readily available for this. I have very limited knowledge about BPM.
    Request your suggestions here. Please help......
    Thanks in advance.
    Regards,
    Yousuf
    Edited by: Oracle Enthusiast on Feb 13, 2013 10:44 AM

    Hi Lavanya,
    I think the conditional reciever determination in your case might not work. Reason being, you  are trying to send chunks of message i.e., line items based on condition.
    What i am trying to say is, suppose one IDoc has 3 lineitems and for each line item you are trying to achieve the conditionals receiver determination.
    According to me, you can one of the possible solution
    1. You have to genearte 1 IDoc message for each line item and then use the condition
    2. Use BPM
    Regards
    Ramesh

  • Can anyone please give me the logic for this....

    I have a database table and in it i have a field department code. now, that department code might have '00' or '   ' (blank) or anyother value. now i want to add up all the currency amounts with department code '00'  and '  ' (blank) which have same company code and currency type. I called all the entries with '00' into one internal table and enrties with '  ' (blank) to other internal table.
    can anyone give me the logic for adding all the entries at a time.
    thanks in advance.....

    HI Srinivas
    i have a solution for this question.
    Use At control break statement for this.
    Loop the internal table.
    Use at Event AT LAST. In that use SUM Statement. U will get sum of all the numeric fields.
    Or else u can use ON CHANGE OF Currency type
    then find the total amount by adding previouse value with ur current value.
    Like itab1-amount = total + itab1-amount.
    Appent this into ur internal or write it into ur report.
    Reward me if its useful.
    Regards
    Ravi

  • Is there any alternative logic for this issue

    Hello all ,
    I have a  program which is executed as a background job for every 15 minutes . Now my requirement is If this batch job is successfully finished, i have to capture that time and date at which the batch job is successfully finished and update the corresponding time and date in a ZTABLE .
    In order to achieve this , i have created a separate program which will also be running in background.in this program , using the table TBTCO, i m getting the last date and  last time at which the batch job is successfully finished and modifying the ZTABLE accordingly
    Is there any alternate solution for this ?
    thanks&regards,
    G.Pavan

    Hi gpavansap,
    When you define background job in SM36, your first step should be the program which you have scheduled now.
    Create a second step in the same job with another program which would just update system date and time to the ZTABLE. No need to read TBTCO and all.
    The second step would immediately execute as soon as the first step ended successfully.
    If you don't want to create a separate program. you can have a check-box "Update ZTable Only" in the selection screen of the first program itself. If this check-box is selected, the program should only update ZTABLE and do nothing else. Create a variant of your selection screen with this check-box selected and schedule this variant as "Second Step" of your back-ground job.
    Regards
    Suresh

  • How should i write a pcr for this requirement?

    Dear Friends,
           Can any tell me whether we can write a pcr in such a way that if the person resigns the company on any day after 15th his full absence quota(for that month) should be accrued.
          if yes can you tell me  
          what are the key decision parameters i have to use in writing the pcr.
            waiting for you kind reply.
    Regards,
    Sai Prasad.

    Hai Prasad,
    I can give you the logic, cannot write exact rules.
    While genegarting absence quota
    - Check for termination action using OUTWPMASSN
        - If yes
              Check for Action year current year. (HRS=YSAY, HRS?CURYR)
                  - If its equal to 0
                      Check for current month (HRS=YSAO, HRS?CURMO)
                           - if its equal to 0
                                  check for current day (HRS=YSAA, HRS?CURDY
                                        - if its >=15
                                             generate quota
                           - Exit
    (Note: for this logic you have to generate monthly quota)
    With regards
    Shyam V

  • Table for this requirement

    Dear Cons
         In a service p.o we have given service qty. as 10 ea & price 100/- inr . we want in which table this data is going to store. Also for Text entered in the doc. Header , for this we want to know in which table it will available.
    thanks
    nrk

    Hi
    Check table ESLL.
    regards
    rb

Maybe you are looking for

  • Dreamweaver cs6 keeps adding br tags in code view

    Hi I've just upgraded to Dreamweaver cs6 and am having trouble with the code view. When typing in <script> tags or <style> tags I keep getting two <br> tags automatically inserted. It is really annoying as it puts them on two lines and takes time to

  • Strange match shuffle behavior

    I don't even know how to explain this it's so weird but I'll give it a try. So I recently purchased itunes match. In a nutshell when I leave my house (iphone4) it seems the working symbol (dashed circle) next to my wifi symbol is constantly spinning

  • Opening a new tab in the terminal in the same directory as the current tab?

    Hi, Is it possible to setup the terminal to open a new tab in the same directory as the current tab? Regards, Ken

  • Approval WorkFlow with custom steps

    Hi guys, I need to create, using SPD, a simple workflows with this Outcome step Accepted e Approved so, for example If I have these users in My WF UserA, UserB I want that UserA change the WF step to Accepted and then UserB close the WF with Approved

  • Deply error

    I was building a web application. Everything has been fine all day, until now. When i clicked run, the deploying to tomcat peroid was taking too long so i stopped tomcat. Now when i try to run the porgram i get: C:\Users\evesham\WebApplication1\nbpro