Several conditions

I have a table with the status job such as opening or closing, if I pass the open value, only records with the open status will be filtered, similarly when I choose will be filtered and narrow only to job_status with closing records, I can do this by passing the opening or closing as parameters, but when I'm not all values then all the records in ot_job_stat should be displayed, but when I add more than one condition in the query above, its doesn't give me good results. As I added the column date to the table and I want to filter the data according to several ranges as within the time span what job_types I want, but the query is giving incorrect results.

{code}

CREATE TABLE OT_JOB_STAT (JOB_NO VARCHAR2 (12), JOB_STATUS VARCHAR2 (12), JOB_EQUIP VARCHAR2 (12), JOB_TYPE VARCHAR2 (12), JOB_DATE DATE);

insert into ot_job_stat (JOB_NO, JOB_STATUS, JOB_EQUIP, JOB_TYPE, JOB_DATE) values ('0001 ', 'Open', 'CNC1', 'Prev', TO_DATE('01/01/2014'));

insert into ot_job_stat (JOB_NO, JOB_STATUS, JOB_EQUIP, JOB_TYPE, JOB_DATE) values ('0002 ', 'Closed', 'CNC1', 'Brk', TO_DATE('01/01/2014'));

insert into ot_job_stat (JOB_NO, JOB_STATUS, JOB_EQUIP, JOB_TYPE, JOB_DATE) values ('0003 ', 'Closed', 'CNC2', 'Prev', TO_DATE('02/02/2014'));

Select * from ot_job_stat

WHERE

JOB_DATE between TO_DATE(:F_JOB_DT,'DD/MM/RRRR') AND TO_DATE(:T_JOB_DT,'DD/MM/RRRR')

and job_type in: job_type or: job_type is null

"- I'm passing job_type as null and: F_JOB_DT = 1 January 2014 ' AND: T_JOB_DT = 1 January 2014"

-its getting all three records, but in fact I don't want the recording of 02/02/2014.

-Result

JOB_NO JOB_STATUS JOB_EQUIP JOB_DATE JOB_TYPE

0002 close CNC1 Brk 01/01/2014

0003 close CNC2 Prev 02/02/2014

0001 open CNC1 Prev 01/01/2014

{/ code}

You mean this?

SELECT * FROM OT_JOB_STAT

WHERE (UPPER (JOB_STATUS) =: STATUS)

(GOLD (: STATUS IS NULL AND 1 = 1))

AND JOB_DATE between TO_DATE(:F_JOB_DT,'DD/MM/RRRR') AND TO_DATE(:T_JOB_DT,'DD/MM/RRRR');

Tags: Database

Similar Questions

  • Output system are made up of several conditions by using the If Condition

    Hello master. I want to create a system of products composed of several conditions using if conditions. The input of the system is derived from "counting" and the second entry is "O". Entry is in order. Then, the expected results are:

    If Y<= 5="" and="" count=""><= 20,="" the="" result="" is="">
    If Y<= 5="" and="" 20=""><30 result="">
    If Y = outcome 30 C <= 5="" and="" count="">

    If <= 5="" y="">= 10 and County<= 20,="" the="" result="" is="">
    If <= 5="" y="">= 10 and 20<30 result="">
    If <= 5="" y="">= 10 and County > = result 30 C

    Thank you for your attention.

    Kind regards

    Fajar

    Assuming that 'A', 'B' and 'C' are digital issued by a calculation, you can use a node of the formula.

    Here is a small example based on your rating (a bit confusing).  It can be slightly changed, but it might be a starting point (assuming I understood you, and you're only dealing with the numeric data types simple as described in your example).

    The case could just to do this using regular functions of comparison of LabVIEW and data flow.

  • If several conditions

    Hi Expert...

    Im trying to make if several conditions in acrobat javascript, so my problem is simple I want to draw the attention of the user and then change the value of the field if the user enters a wrong number... so my approach was what follows... but it gives me errors (in custom for the field validation scripts)

    Switch (event.value) {}
    case '0 ':

    this.getField("PeriodVar").value = 20;

    App.Alert ("zero not accepted");

    break;
    case ' ':

    this.getField("PeriodVar").value = 20;

    App.Alert ("empty not accepted");

    break;
    20 > case study:

    this.getField("PeriodVar").value = 20;

    App.Alert ("more than 20 not accepted");

    break;
    }

    I tried to do several condition with other, if but also I have faild, I only success in the following code in the function:
    function checkmaxperval()
    {
            var maxsum = getField("PeriodVar");
            var usingsum = maxsum.value;
               if (usingsum > 20 ) {
                    app.alert("maximum value is 20 only", 3);  
                    maxsum.value = 20;
                   return;
    }
    

    Looks like you were trying to have a 'case > 20' - it is not valid JavaScript. Each case must be a distinct value.

    You are better to do an if/else if/else statement:

    if (event.value == 0) {
      // do someting
    }
    else if (event.value == "") {
    // do something else
    }
    else if (event.value > 20) {
    // do something else
    }
    else {
    // this catches anything that was not yet handled
    }
    

    That said, I would advice against searching for an empty string: the problem with this is that you cannot easily remove a value, and then replace it with valid data, or leave it blank and move on to come back later. I suggest you handle these cases later, for example when the form is submitted: have a function that checks the 'required' fields that are empty. See for example here for the code that would do this: loop through the required fields before submitting the form (JavaScript)

    Your second code snippet is missing a '} '.

  • Several Conditions of region

    Hello

    I have a region that I would have several conditions

    • The first condition is to show the region on some pages... so I use «page...» »

    AND

    • the second location is where an item = value

    Any ideas on how I can use both at the same time with the other to show / hide elements where two conditions are met... for example

    page = 28,31,32,67,86,364 and: ITEMZ = YES

    any ideas or alternatives?

    Thank you

    Tod

    HI Tod,

    Try to use a condition of PL/SQL and try:

    [code]

    : APP_PAGE_ID in (28,31,32,67,86,364) and: ITEM = 'Y '.

    [/ code]

    Paul

  • several conditions for dhtml menu drop-down

    RH11 Webhelp

    Chrome browser

    First of all, thank you to Peter Grange for his column on conditional text in tables. This problem doesn't seem to be there, so thank you for help.

    • The terms in my table (for example ' Print button') are dhtml drop-down lists that I want to assign several conditions.
    • Assign a condition and generating the poster State correctly the term in the webhelp generated.
    • Assign several conditions and generate the conditions causing the term to not be displayed at all.

    What is a dhtml limitation?

    DHTML should not be the problem. It is more likely to be linked to your tags and expression.

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • If statement several Conditions

    With the help of LiveCycle, FormCalc or JavaScript.

    I am trying to create an if statement with several conditions.

    a Sum field calculates a set of numeric entry fields. I want the result in the amount field to determine the expression in a final field.

    If the sum is < 30MM then '50000' also if the sum is > 30MM but < 60MM then '125000' also if the sum is > 60MM but < 100MM then "250000" also if the sum is > 100MM but < 300MM then '375000' also if the sum is > 300MM then "500000".

    I've been able to understand one so so for the first condition, but not able to include all the conditions and multiple results.

    Help would be much appreciated!


    Thank you in advance.

    Send your form to [email protected] and I'll take a look and see what is wrong.

    Paul

  • Several conditions in a trigger

    I need a trigger to perform an insert, but the values will be different according to the values inserted in the table causing relaxation. Here is the code:
    CREATE OR REPLACE TRIGGER users_in_roles
    AFTER INSERT ON users REFERENCING NEW AS new
    FOR EACH ROW
    WHEN ( new.agcy_cd = 'AA' )
    BEGIN
       INSERT INTO users_in_roles(role_seq, user_seq)
       VALUES( 5, :new.user_seq );
    END ;
    
    WHEN ( new.agcy_cd = 'AB' )
    BEGIN
       INSERT INTO users_in_roles(role_seq, user_seq)
       VALUES( 20, :new.user_seq );
    END ;
    
    WHEN ( new.agcy_cd = 'AC' )
    BEGIN
       INSERT INTO users_in_roles(role_seq, user_seq)
       VALUES( 30, :new.user_seq );
    END ;
    
    WHEN ( new.agcy_cd = 'AD' )
    BEGIN
       INSERT INTO users_in_roles(role_seq, user_seq)
       VALUES( 40, :new.user_seq );
    END ;
    
    END TRIGGER users_in_roles ;
    /
    What's the correct syntax to have several conditions? It compiles with errors:
    Error (6.1): PLS-00103: encountered the symbol "WHEN".
    SQL> create table users (agcy_id varchar2(2), user_seq number);
    
    Table created.
    
    SQL> create table users_in_roles (role_seq number, user_seq number);
    
    Table created.
    
    SQL> create or replace trigger users_in_roles
      2   after insert on users
      3   referencing new as new
      4   for each row
      5   when (new.agcy_id in ('AA', 'AB', 'AC', 'AD'))
      6  begin
      7   insert into users_in_roles (role_seq, user_seq)
      8   select case
      9            when :new.agcy_id = 'AA' then 5
     10            when :new.agcy_id = 'AB' then 20
     11            when :new.agcy_id = 'AC' then 30
     12            when :new.agcy_id = 'AD' then 40
     13          end
     14   ,      :new.user_seq
     15   from    dual;
     16  end;
     17  /
    
    Trigger created.
    
    SQL> insert into users values ('AA', 12);
    
    1 row created.
    
    SQL> select * from users_in_roles;
    
      ROLE_SEQ   USER_SEQ
    ---------- ----------
             5         12
    
    1 row selected.
    
    SQL> insert into users values ('$$', 1);
    
    1 row created.
    
    SQL>  select * from users_in_roles;
    
      ROLE_SEQ   USER_SEQ
    ---------- ----------
             5         12
    
    1 row selected.
    
    SQL> insert into users values ('AD', 10);
    
    1 row created.
    
    SQL> select * from users_in_roles;
    
      ROLE_SEQ   USER_SEQ
    ---------- ----------
             5         12
            40         10
    
    2 rows selected.
    
  • Several Conditions in discoverer

    Hello

    I'm new to the discoverer and I am facing a problem in creating several conditions! I want to create a condition as follows:

    (X not as 'External fault %') OR (X % not as "customer equipment") ET (Real time * < = * KPI hours)

    - - - - - - - -


    I can achieve at this stage for OR

    ! http://www.freeimagehosting.NET/uploads/8517f17f52.jpg!


    But when I tried to add AND or, it will change OR AND

    Example:

    ! http://www.freeimagehosting.NET/uploads/84ec85f131.jpg!

    Is this possible in discoverer?
    Please, I'll be happy with your comments and suggestions. Thank you!

    Mohammed Rafea

    Edited by: user11111046 may 3, 2009 08:19

    Edited by: user11111046 may 3, 2009 08:25

    1. define a condition containing gold

    (X not as 'External fault %') OR (X not like ' % of customers own equipment ")

    and give it a name, for example, condition1

    2 set a condition for the part AND

    (Real time<= kpi="">

    and give it a name for example condition2

    3. in the condition dialog box finally uncheck condition1 and condition2 conditions so that they are not selected for this worksheet.

    4. create a third condition and instead selects an item, you can select a condition. Condition1 here click to add as many lines and select and. Then you select condition2 so that this condition contains

    condition1 AND condition2

    Rod West

  • Several Conditions on the stage of processing of forms?

    You are allowed to set several options in the Conditions of implementation of a conditional processing step Editor. However, unlike filters in a Segment, the Conditions Editor doesn't tell you if the conditions are joined by 'and' or 'or '. So in the example below, step run, for anyone who enters their State as the Georgia or Florida? Or would look of someone who had both the Georgia AND Florida as a State and, since you can't have both, not run processing step?

    Conditional_Form_Processing_Steps.png

    Thank you.

    If you try to 'OR', depending on the processing stage, you can try to use the option "use a drop-down list to select... "on the stage of treatment rather than using the option under certain conditions. Using a drop-down list, you can download a list of States (like your model) under the name of the Option, then the code active for e-mail, landing page, shared list, etc. for the value of the Option. This avoids the multiple processing steps using different conditionalities.

    Just download the ID and the values in a list of successful selection

    For emails and landing pages active IDS are easy to find using the URL that is displayed when you have open in Eloqua:

    https://secure.P03.Eloqua.com/main.aspx#landing_pages&ID= 115


    Update processing step to «Use a drop-down list to select...» ", select the form field and the managed choice list you downloaded.

  • Dynamic with several Conditions when action

    APEX 4.2 on XE

    Hi all, I'm trying to create a dynamic Action based on several when conditions... The docs seem to indicate you can do, but I can't seem to trigger.

    Basically I have a DA

    Event: change

    Selection type: item (s)

    Article (s): P42_NEW_REC, P42_STATUS_ID

    Condition: equality

    Value N, 43

    Individually, these trigger very well, but does not fire? Is it possible to have several times conditions? If so, what is the problem with the above.

    Alternatively, if not, if someone could give better advice to achieve the same thing, Id be grateful...

    Rgds

    Richard

    Hello

    Use the condition list

    Kind regards

    Jari

  • Index and MATCH with several conditions

    Hi all! I hope I can explain what I'm trying to do here clearly. This is my first shot:

    In the table below "Office entry Worksheet - area 1" I am trying to insert a formula in column B which will result in an answer ' true / false ' and be used for conditional highlighting

    The first condition that must be met is that the checkbox in the table "Labor and material Checklist" column A or check, if it is not checked, then move to the next line. If the box is checked, then the following condition would need to index and match with column C of table "Office entry Worksheet - area 1" in column B. If there is a match in column C, then move to the next line of column B in the table 'labor and material Checklist '. This continues until there is a 'match', then highlight column B in the table "entry Office sheet - surface 1" in red (or something like "MISSING task")

    It is an estimate and the idea is to ensure that the Phases that are checked in the table "Labor and material Checklist" will not miss when you use the table "entry office map - zone 1".

    Thank you very much for your help!

    Tim

    Is it possible that I can download this spreadsheet file?

  • Case of Structures run a particular set of code for several conditions?

    Structures of the event may have a single case of event manage several event specifiers.

    C code supports this kind of statement 'switch ':

    Switch (EnumValue)
    {
    case a:
    case b:
    handleAOrB();
    break;

    case c:
    case d:
    e case:
    handleCOrDOrE();
    break;

    by default:
    handleOther();
    }

    How about Business Structures? Can I attach a code block to multiple values to enums? (without duplicating cases, which might be a maintenance nightmare)

    Edit: the closest thing I found is http://forums.ni.com/t5/LabVIEW/case-structure-multiple-inputs/td-p/2377132, but my original enum in another conversion is a bit rude

    You can specify multiple values enum for a particular case. Is that what you're looking for?

    For more information, see the series of weekly nuggets that I wrote on the case Structures: part 1, part 2, part 3, part 4and part 5.

  • Evaluate several conditions.

    Hello

    I have three sets of routine developed in LabVIEW. I need to run these blocks when certain condition is met, for example,

    If condition 1 is true

    run block 1

    Otherwise, if condition 2 is true

    run block 2

    Another condition 3 is true

    run block 3

    Inputs and outputs are similar in each block. I was hoping to use the state machine architecture but still don't no idea how to do it.

    Kind regards.

    Your problem may be treated with a triply nested case structure.  Evaluate the Condition 1.  The real is "Execute Block 1".  The case of wrong is another matter structure, evaluate Condition 2, True = Execute Block 2, False = another structure of matter, assess the Condition 3, Execute Block 3 = True, False = do nothing.

    If you want to do this in a Machine States, you can proceed as follows: set the following States - 1 evaluate, run 1, review 2, run 2, released 3, run 3.  The State 1 assess don't 'value 1' and if it is true, call State run 1, otherwise it calls State evaluate 2.  You fill in the rest.  Note that you should probably have another State, 'Continue', all the States enforcement (and the wrong case to assess 3) call when they are made, so you don't "stuck".  On the other hand, if the state machine is a Subvi, you could just output (which is another "Pseudostate").

    Bob Schor

  • Find entries with several conditions, including the comparison

    Hello

    I take the edition of I v6.2.7 a ride, I'm looking at the use case is the following. I have a "table" with about 100 k records defined by this object:

    @Entity
    public class LTROW {
    
      @PrimaryKey
        private Integer id = null;
    
        @SecondaryKey(relate=Relationship.MANY_TO_ONE)
        private Integer tableId = null;
        
        @SecondaryKey(relate = Relationship.MANY_TO_ONE)
      private String col0 = null;
        @SecondaryKey(relate = Relationship.MANY_TO_ONE)
        private String col1 = null;
        @SecondaryKey(relate = Relationship.MANY_TO_ONE)
        private String col2 = null;
        @SecondaryKey(relate = Relationship.MANY_TO_ONE)
        private String col3 = null;
        @SecondaryKey(relate = Relationship.MANY_TO_ONE)
        private String col4 = null;
        @SecondaryKey(relate = Relationship.MANY_TO_ONE)
        private String col5 = null;
        @SecondaryKey(relate = Relationship.MANY_TO_ONE)
        private String col6 = null;
        @SecondaryKey(relate = Relationship.MANY_TO_ONE)
        private String col7 = null;
        
        private String result0 = null;
        private String result1 = null;
        private String result2 = null;
        private String result3 = null;
        private String result4 = null;
    // ...
    }
    

    Typical research I must apply is: give me all the entries contained in tableId X where the value of co0 is equal to 7, 1112 exceeds the value of col1 and col2 value is less than 8.

    I got in the definition of index for all columns defined in the class, but can't seem to understand how to combine these criteria. I looked at EntityJoin but it doesn't seem to be what I'm looking for.

    Thank you!

    You cannot use multiple indexes for this kind of query. Instead, create and use a single index for one of the conditions and filter on other conditions. I hear, by 'filter' select the records you want using an 'if' statement Try to choose the index that returns the smallest number of records.

    See:

    http://www.Oracle.com/technetwork/database/database-technologies/BerkeleyDB/performing.PDF

    -mark

  • Error exporting in the level of query with several conditions

    When I run the following query to export with the result.



    C:\Documents and Settings\ITL > exp scott/tiger@orcl tables = (emp) QUERY = "" WHERE deptno > 10 and sal! 2850 = "' LOG = log011.log FILE = exp.dmp"

    Export: Release 10.2.0.1.0 - Production on Wed Jan 30 10:01:27 2013

    Copyright (c) 1982, 2005, Oracle. All rights reserved.


    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With partitioning, OLAP and Data Mining options
    Export performed WE8MSWIN1252 and AL16UTF16 NCHAR character set

    About to export specified tables by conventional means...
    . . export the rows in the table EMP 10 exported
    EXP-00091: exporting more than questionable statistics.
    EXP-00091: exporting more than questionable statistics.
    Export completed successfully with warnings.



    But when I run it with the following condition, then it displays the following error...




    C:\Documents and Settings\ITL > exp scott/tiger@orcl tables = (emp) QUERY ='"WHERE deptno > 10 and work!" = 'CLERK' ' ' LOG = log011.log FILE = Exp01.dmp.
    LRM-00111: no closing quote for value 'LOG = log01'

    EXP-00019: failure of the treatment of parameters, type 'HELP EXP = Y' help
    EXP-00000: export completed unsuccessfully


    C:\Documents and Settings\ITL > exp scott/tiger@orcl tables = (emp) QUERY = "WHERE deptno > 10 and work! = 'CLERK' ' LOG = log5.log FILE = exp01.dmp
    LRM-00112: multiple values not allowed for the parameter "query".

    EXP-00019: failure of the treatment of parameters, type 'HELP EXP = Y' help
    EXP-00000: export completed unsuccessfully


    Please suggest a solution for this.

    Hello

    Single quotes used for CLERKS are very probably the origin of the problem.
    C:\Documents and Settings\ITL > exp scott/tiger@orcl tables = (emp) QUERY ='"WHERE deptno 10 > and job!" = 'CLERK' ' ' LOG = log011.log FILE = Exp01.dmp.

    try to replace this
    C:\Documents and Settings\ITL > exp scott/tiger@orcl tables = (emp) QUERY ='"WHERE deptno 10 > and job!" = "REGISTRAR" "' LOG = log011.log FILE = Exp01.dmp.

    Two single quotes (no quotes) to place an apostrophe for CLERK.

    Thank you
    Padma...

Maybe you are looking for

  • Plot data erased on Autoscale

    I am currently working with a very simple VI which consists of a dial connected in a conspiracy with a relay between the two. The relay is controlled by a switch flip. The purpose of this configuration is that the plot display values for the wheel on

  • 9263 update tension to slow

    I am using a cDAQ 9172 with modules NI9263 VO and NI9205 VI. I want to read a (feedback) voltage and adjust the output voltage to read a porportial of the voltage value in. The problem I'm having is that the 9263 seems to slow down. I need to update

  • Someone stole my AOL address and sending bad links to everyone in my contacts directory. What can I do? Help

    Someone sends emails to everyone in my address book using my AOL address.  I get a rear rejected email for some, but for others they are delivered and people are asking what is happening.  Help, please.  Do I have to change my email address?

  • WLM 2011 build 15,4,3502,922

    Since yesterday, I have a serious problem with my WLMAfter that I signed and noticed a huge download on my computer... aprox. 100 MB in less than 2 min.What and where and still do not know.Antivirus (AVIRA and Malwarebyte) programs do not viruses or

  • SecureDataSource

    So I guess the data source object supports only supported HTTP and HTTPS not?  This seems rather incomplete for me. Not sure why BB would choose of does not support HTTPS. In any case... someone at - he expanded the DataSource object to create a cust