How to add a condition to this statement.

Hi friends,

I have a requirement of the customer.

Let me explain the scenario.

I have a table, which contains some employees say 1, 2,3,4.


So I wrote a query so that it...

Select * from where a trunc (sysdate) between effective_start_date and effective_end_date person_id =: p_person_id;

in this statement, I would like to add a condition more say

If person_id in (1,2,3,4) then
p_person_id: = null;
on the other
p_person_id = person_id;

the addition of this condition in mysql statement...

can someone help me with this...

Thanks in advance.

Hello

Looks like that (no data, not yet tested)

select * from A
 where trunc(sysdate) between effective_start_date and effective_end_date
   and person_id = CASE
                      WHEN NOT :p_person_id in (1,2,3,4)
                      THEN :p_person_id
                      ELSE person_id
                   END;

Concerning
Peter

Tags: Database

Similar Questions

  • Currently can not find out how to add radio buttons to this javascript to make it work on them also.

    I am trying to add radio buttons to the if statement so that they are highlighted when not clicked aswell

    Thank you very much

    var emptyFields = [];

    var completedFields = [];

    for (var i = 0; i < this.numFields; i ++) {}

    var f = this.getField (this.getNthFieldName (i));

    v var = this.getField (this.getNthFieldName (i));

    If (f.type! = "button" & & f.required ") {}

    f.strokeColor = color.black;

    f.fillColor = color.white;

    If ((f.type=="text" & & f.value== "") |) (f.type == "checkbox" & & f.value == "Off"). (v.Value=="")) {

    emptyFields.push (f.name);

    f.strokeColor = color.red;

    f.fillColor = color.white;

    }

    }

    }

    If (emptyFields.length > 0) {}

    App.Alert ("error! You must fill in all the mandatory fields (highlighted in red)");

    }

    Try the following. I removed some superfluous things and formatted for readability.

    var emptyFields = [];

    for (var i = 0; i)< numfields;="" i++)="">

    var f = getField (getNthFieldName (i));

    If (f.type! = "button" & f.required) {}

    f.strokeColor = color.black;

    If)

    (f.type == 'text' & f.valueAsString == "")

    || (f.type == "checkbox" & f.valueAsString == 'Off')

    || (f.type == "radiobutton" & f.valueAsString == 'Off')

    || (f.type == "combobox" && f.valueAsString == "")) {

    emptyFields.push (f.name);

    f.strokeColor = color.red;

    }

    }

    }

    If (emptyFields.length > 0) {}

    App.Alert ("error! You must fill in all the mandatory fields (highlighted in red)");

    }

  • addChild (new button()) - how to add a name to this new created button

    Hello

    Lost my old username, I've been Pluda, now exPluda?

    Tring well, use a loop to add buttons to my work, but should refer to their names so I can have diferent x positions for each. How to do this?

    for (var sm:uint = 0; sm < sub_menus.length; sm ++) {}
    hsm.addChild (new bt_sub_menus());
    HSM.bt_sub_menus.x = hsm.x - 10;
    HSM.bt_sub_menus.y = hsm.bt_sub_menus.height + sm * 15;

    }

    This does not work, I just get a button placed where I want.

    Thank you!

    1. go to the faq section of the forum and send a private message to one of the admins to let them know.  they are very conscientious and helped me when my original kglad id has been changed in kglad-HNsomethingorother.

    2.

    for (var sm:uint = 0; sm< sub_menus.length;="" sm="" ++="" )="">

    var btn:bt_sub_menus = new bt_sub_menus()
    hsm.addChild (btn);
    BTN.x = hsm.x - 10;
    BTN.y = hsm.bt_sub_menus.height + sm * 15;

    }

  • How to use if condition inside a statement case?

    Hi all

    It's my code and the error. Please help me.

    SQL > select case when value (1000) then null
    2 when the user in ('ABC'), then the user
    3 when area ("Denver") then
    4. If value = 2000 then 'Service1 '.
    5 other value = 3000 and then "Service2.
    6 end if
    7 another null
    8 end as service_usoc_ref num_code;
    If main = 2000 then "Omaha".
    *
    ERROR on line 4:
    ORA-00905: lack of keyword

    Thank you...

    Try this...

    select
         case
              when value in (1000) then null
               when user in ('ABC') then user
               when area in ('DENVER') then
                      decode(value, 2000 , 'Service1', 3000 ,'Service2')
               else null
          end as num_code
    from service_usoc_ref;
     
    

    Here is the reference for more information on Decode for your use:
    http://www.techonthenet.com/Oracle/functions/decode.php

    Kind regards
    Lifexisxnotxsoxbeautiful

  • How to add a PPR to the button when running

    Hi all
    I have a text named "status" entry and it has links to this method
          public void setStatus(RichInputText status) { 
            setCurrentRecordStatus((String)status.getValue());
            System.out.println("status value is"+(String)status.getValue());
            status.setAutoSubmit(true);
            this.status = status;
        }
    And I have the "submitBtn" command button and I set the disable property to this method
          
        public boolean isDisableSubmitButton() {
          if (getCurrentRecordStatus() == "E") {
              disableSubmitButton=false;
          } else {
             disableSubmitButton = true;
          }
            return disableSubmitButton;
        }
    
        public void setCurrentRecordStatus(String currentRecordStatus) {
            this.currentRecordStatus = currentRecordStatus;
        }
    
        public String getCurrentRecordStatus() {
            return currentRecordStatus;
        }
    I want to put the partial "trigger" property of the command key is the id of the input text 'status' when running so that the property enable and disable the Refresh button.

    I can't do this design-time for many reasons, one of them is that the button is on the template and the content of the page changes after menu selection.

    My question is: how to add a PPR to this button during execution?
    Help, please
    Thank you

    Hello

    Try like this I hope this helps.

    for example:

    Jspx page:





    At the bean:

    private RichPopup * bindpopUp *;

    public String testmMethod() {}
    AdfFacesContext.getCurrentInstance (.addPartialTarget(*bindpopUp*));
    Returns a null value.
    }

    * Note :*

    Add partialsibmit if you use all the action in the component.

    Remove the partial triggers in the page, if you gave for the same component in the managed Bean. Add target partial bean or in the page... in a place...

    Kind regards
    Guillet

  • How will I know if a connection site is secure? In Safari or Explorer, there is an icon lock visual, but not in Firefox. Is there an add-on that meets this need?

    How will I know if a connection site is secure? In Safari or Explorer there is a locking visual icon in the web browser window, but not in Firefox. Is there an add-on that meets this need?

    The padlock shows only that there is a secure connection and does not guarantee that you are connected to the right server. So you could always be connected to the wrong server if you make a typing mistake in the URL and someone said that mistyped the URL. The lock feature has been replaced by the identity button of the Site on the left end of the address bar (address).

    https://support.Mozilla.com/en-us/KB/site+identity+button

    http://www.Mozilla.com/en-us/Firefox/security/identity/

    This has actually existed since Firefox 3.0

    If you still want an icon of padlock also then there is this Extension.
    https://addons.Mozilla.org/en-us/Firefox/addon/padlock-icon/

  • How to add this bar of the spectrum in labview?

    Anyone know how to add the bar spectrum (see attachment file, arrow6) in labview and make the plot shows different color when the value goes down there in different range?

    Thank you very much

    Try this.

  • Please can you identify it and tell me how to add this toolbar in Dreamweaver CS5?

    This is the toolbar.

    Toolbar.JPG

    its used in this video to youtube from the minute 30.

    How to build a registration system user - password for registration, Login, Email, update, Admin Backend - YouTube

    Trying to figure out how to add hours now?

    Thank you

    Carl

    Take the "Insert" tab and drag slot bar main menu until you see a blue outline appear, and then release.

  • How can I add pictures as a fill State assets om in widget menu?

    How can I add pictures as a fill State assets om in widget menu?

    Can we go to the window/Fill to open the Toolbox options filling instead of the menu list?

  • How to add this type of effect in photoshop plugin

    How to add this type of effect in photoshop plugin

    facebook-20150225-193846.png

    There are commercial Photoshop actions available for this type of effect, if you search on GraphicRiver Photoshop-> Actions-> and then do a search for 'Paint' within these results. Here is an example:

    Effect of paint 20 - Photoshop Action | GraphicRiver

    I am not affiliated with that one either by the way, I just did a quick search there and it was one of the first results. You can also find people offering similar actions for free, you can follow step by step and see how it's done.

  • How to add a background color transition to this menu

    Hi all -

    Struggling to add transition: background color ease 0.5 s; for this menu

    http://www.ossiningdesignguild.com/RWDnav.html

    CSS is here:

    http://www.ossiningdesignguild.com/rwdnav.CSS

    I tried to add to ul li a without success and I would appreciate a helping hand.

    Thanks as always...

    Remove the bottom of the NAV UL. This State is not changing as you do not have: hover class

    You want to trigger a change on: hover ul li then add funds to that:

    NAV ul li a {}

    other styles

    Background: #222;

    -webkit-transition: context facilitated in 0.5 s.

    -moz-transition: context facilitated in 0.5 s.

    -ms-transition: context facilitated in 0.5 s.

    -o - transition: context facilitated in 0.5 s.

    transition: context facilitated in 0.5 s.

    }

    NAV ul li a: hover {}

    Background: red;

    }

    You used gradients and if you try to animate you will get them a flash, you may need to use-webkit-backface-visibility: hidden; to fix this.

    http://css-tricks.com/almanac/properties/b/backface-visibility/

    CSS3 - Webkit facilitate transitions gradients - Stack Overflow

  • He must add the condition to a model and cannot do this work.

    I am trying to add a condition to a model and cannot operate. Mainly because I'm new to this. I have a domain that needs to have a defined condition. The field is Ltd. The maximum value is $233,00. If the amount is less than the 233, this value is used. If it is more than 233 233 is used. If LTD. is bigger than 233.00 Ltd else then 233.00

    Can someone help me to write this, for a Word of Publisher BI model. I need this report now, but can't go to class until later this year.

    Thank you

    Rick

    Replace LTD with the name of the correct item.

    
     233 ?>233
    
    
    
  • How to add &amp; quot; Print this page &amp; quot;

    How can I add the "Print this page" option so that it will open a resized page that can be printed?

    http://www.alistapart.com/articles/goingtoprint/

    "Mr_Torch" wrote in message
    News:eiqm4a$2KP$1@forums. Macromedia.com...
    > How can I add the option 'Print this page' so that it will open a
    > resized the page can be printed?

  • How to understand this statement?

    How to understand this statement?
    What is a public constructor zero-setting

    < partitioning/class name key - >: Specifies the name of a class that implements the com.tangosol.net.partition.KeyPartitioningStrategy interface. This implementation must have a zero-setting public constructor.

    It's a public constructor that takes no parameters. See the following simple class.

    public class Platypus
    {
      public Platypus() {} //public constructor with no arguments
    }
    
  • How do I rename the folder of bookmarks 'Unsorted Bookmarks '? or add a folder at this level?

    With the help of Windows8 Firefox EU euballot - 1.1.
    Try to rename the folder of bookmarks 'Unsorted Bookmarks'? or add a folder at this level?
    I tried the suggestions in the forum (ie. Shift ctrl B); access to the file through library; all no chance.

    When you try to add a new folder on the same level as the 'Unsorted Bookmarks' folder, the new folder appears in the folder "Unsorted Bookmarks" and not on the same level.

    Something that I missed?
    Thanks for your suggestions.

    I do not recommend this. IIRC, users have mentioned that this folder has been renamed, when they started a new "Unsorted Bookmarks" folder has been created automatically when Firefox.

Maybe you are looking for