Select Negation

Hi!
I've got this Select Statement with a count of 350:
SELECT Count(*) FROM table_a a
WHERE a.f1 = 'AA'
AND a.f2 = '2005'
AND a.f3 IN ('PBW1', 'PBW2')
A Select count(*) from table_a has 1141637 counts.
Now I have to negate this select to get all Datasets I don't want.
SELECT Count(*) FROM table_a a
WHERE a.f1 <> 'AA'
OR (a.f2 = 'AA' AND a.f2 <> '200508')
OR (a.f2 = 'AA' AND a.f2 = '200508' AND a.f3 NOT IN ('PBW1', 'PBW2'))
But this count gives me 1138023 Datasets. This is not correct. There must be more (see 1141637 without where statement). With debugging I found out, that everything works fine up to the second AND Statement.
Negating AND a.f3 IN ('PBW1', 'PBW2')
to OR (a.f2 = 'AA' AND a.f2 = '200508' AND a.f3 NOT IN ('PBW1', 'PBW2'))
brings the error or mistake or what ever. Using where not(...) or other options also doesn't work.
Where is my Mistake? What do do? Couldn't I negate an IN statement?
How can I solve this Problem???
Greets
Sascha

Got any NULL values in one of those fields? If yes, those Records would fail both the initial and the NOT where clause.
See this example:
WITH table_a AS (SELECT 'AA' f1, '2005' f2, 'PBW1' f3
                   FROM dual
                  UNION
                 SELECT 'AA' f1, '2005' f2, 'PBW2' f3
                   FROM dual
                  UNION
                 SELECT null f1, '2005' f2, 'PBW2' f3
                   FROM dual
SELECT COUNT (*)
  FROM table_a a
WHERE NOT (
       a.f1 = 'AA'
   AND a.f2 = '2005'
   AND a.f3 IN ('PBW1', 'PBW2')
   );Count returns 0 records.
C.
Message was edited by:
cd

Similar Messages

  • Acquisition value negative in area 20

    Hi Guys
    I have an issue while settling cost from project to AUC, i am getting the error "Acquisition value begative in area 20" hence i am unable to settle to AUC
    I have checked the depreciation area 20 of that asset and negative values allowed is selected
    I have checked the AUC asset class and negative values allowed is selected for all dep areas
    please advise
    Thanks
    anand

    Hi...
    as per  your issue
    You should do same settings for all depreciation  areas which in your AUC asset master in the AS02 in the Depreciation area tab.(Double click each Dep area and select Negative values allowed indicater )
    and also you have to select for your asset class (select Negative values allowed indicater ) which belogs to AUC asset and even its not allowing also select for your screen layout rule (select Negative values allowed indicater )
    I am sure you can bale to post  and confirm
    Regards
    vamsi

  • Creating negative when sending to RIP

    Okay I ran across this last week again.
    I have a 1 spot AI file that I place into ID. I need this file to be emulsion side up and negative. So I flip the image horizontally and select "negative" in the output options. I check the file at my RIP station and it is NOT a negative.
    I don't do this type of file often so I have been just placing into Quark and selecting Negative in the Print Options there.
    So, what am I doing wrong in ID? Shouldn't I be able to output the file to a negative in ID just like I can in Quark?

    I just looked for an Eagle RIP booklet (still have the box here). I do NOT see a book in the box, and I know that it has limited capabilities. I'll have to do a search on the web to see if there is a setting in there. I just seems a little weird that Quark can do it okay and ID can't. And I really would prefer to do this through the print dialog instead of setting up the AI file negative from the get-go, as this particular file is not always printed with this printer and doesn't always need to be negative.
    Not sure how to convert it to a negative in Acrobat 9 Pro when going to print. EDIT=just saw it in the options and will try it.
    And I set the file up in ID in order to step it out accurately. It's a business card with front and back so I have to be sure that it lines up 100% (and I don't like stepping files in AI). Plus when I go to my print dialog in AI the option for negative is grayed out and set to positive (this is in AI):
    It could very well be a drive issue. I have had some problems with the driver on my color printer here at work (which is located upstairs from me). My IT guy decided to update that driver and it stopped working for me. He claims to have reverted it back, but that didn't work either and downloading and installing a new driver also did not help.
    I guess for now I will be stuck with Quark on this issue (as I said it doesn't come up often). And since business is slow I doubt I can convince my boss to call out someone to update the drivers and fix my printing issues (my IT guy here doesn't deal with MACs).

  • Credit memo for asset with depreciation posted

    HI,
    There is requirement to pass a credit memo for an asset.
    The asset was purchased on 01.04.10.
    And have been depreciated till 31.05.11.
    Now the client want to pass credit memo for the full acquisition value.
    My issue is when I am passing the entry through ABGF - ... in Next Year
    System is throwing error stating the value is going negative.
    Then we passed the write up for the depreciated value as on 01.04.10.
    Still system is giving the same error message.
    Please suggest on what date should I pass the write up to clear the whole posted depreciation and pass the credit memo.

    Hi,
    Go to asset master change, in depreciation are tab double click on depreciation are number  then select negative values allowed check box
    Hope this will help you.
    thanks!

  • AUC Asset and depreciation error in Area 20

    Hi All,
    I have a problem with AUC settlement,  there is negative values in my AUC (Area 01, no values in Area 20) and when I am settle that to Asset master I got the error message Negative values not allowed in Area 01.   So I have selected negative values allowed check box for  Area 1 and Area 20 in AUC asset master data, now the settlement is fine and have settled that.
    Now the main problem I am facing is, here am seeing the balance of negative value on AUC asset under the Area 20 and also the total negative value is picking as Accumulated depreciation.
    Could you one provide the ideas how the nagative balace went in Area 20 and why it caluculated depreciation even though the depreciation key is 0000.
    Thanks
    Sreenivas

    Hai Qian,
    You can maintain the Net book value and special depreciationall values allowed in OADB t.code or whtever fields u want the maintain the All values allowed
    Regards
    Madhu I

  • Check list for testing

    Hello everyone,
    I am trying to put a document together to have a check list for integration testing.  does anybody have anything like this that can share? Or any tips of what steps should be taken in consideration to complete integration testing?
    Thank you for your help!

    Hi,
    1)  Integration testing validate end to end business scenarios including interfaces.  Use converted data (if applicable and based on the data strategy).  Can be executed in multiple cycles based on the implementation strategy
    2)  Scenario-based testing across process areas
    May include multiple t-codes, or equivalent units in a string or sequence
    3) Testing across modules
    4)  Primarily deals with cross-application chains that directly or potentially impact each other
    5) Consists mostly of positive testing with selected negative testing
    6) Executed in the Quality Assurance test environment
    7) Integration Testing will be performed in multiple cycles
    8) Next cycle should not begin if critical discrepancies have not been dispositioned.  All Integration test discrepancies must be closed by the end of the last integration test cycle
    9) A discrepancy can be dispositioned if:
      Retest Passes or
      Workaround approved or
      Alternate resolution approved
    Regards
    R. Senthil Mareeswaran.

  • Error while executing MR11 -

    Hi Experts,
    I am trying to execute MR11 transaction code to clear GRIR clearing account, but I am receiving the error " Acquisition value negative in area 30"
    Can anyone explain me why this error is coming here.
    I think for this error, in asset master record, I have to select "Negative values allowed " check box. Please correct me, if I am wrong.

    You may do that! Possibly the asset transaction involves foreign currency, By permitting -ve values, you may get through this message.

  • How reverse colors in pdf

    I have a pdf with white text on a dark background.  So that it doesn't use up all of our toner, I would like to reverse the colors to black text on white background.  Can that be done in Acrobat?
    If not, I have the full Design Premium 5.5 suite but don't know much about the programs other than Acrobat (and don't understand it very well).  
    I would deeply appreciate simple, clear directions. 
    Not sure which forum to submit this question to.  Apologies if this is not the right one. 
    Thank you.

    Try this, my screen shot is from AA9 Pro.
    From the Print Dialog, choose Advanced to open the dialog shown.
    (I had selected a Postscript printer; testing with a generic ink jet does not allow such.)
    Choose Comp Gray and select Negative as shown.

  • MB5L - analise variance

    Dear all,
    In MB5L, for one stock GL account, we have some differences (negative diferences) how can we found the origin of the differences? I don't know how to procede.
    Best regards,
    Iné

    Hi,
    In MB5L scope of list you might have selected negative stocks. Hence the system showing negative values present to that material. The negative stocks will arise during goods issue. When the goods issue has done BEFORE GR with more quantity than the GR QUANTITY .The negative stock will be shown for the material. When a new GR entered for that material which satisfying the quantity, the system nulifies the negative stock. In your case negative stock is there bacause there may be GI done before GR. The GR yet to receive. I hope this will resolve your issue. Thanking you.

  • How do I disallow negative numbers in a selected group of cells (i.e. only allow values greater than or equal to zero)?

    I have a table of calculated values in Numbers, and I want to disallow negative numbers in the entire table. Any numbers that would be negative I would like changed to/displayed as zeroes, that way future calculations that may be based on this cell use the value of 0 for the calculation rather than the negative value. I have seen ways of doing this to single cells at a time, but I am interested in applying it to a large selection of cells.
    There is the Conditional Format option when you bring up the inspector, but I cannot get a custom rule to work for me. I select "Greater than or equal to" and I enter 0 in the box, but nothing changes. Can anyone help with this?
    Thanks

    A step toward simplifying the application of MAX to the issue, Jerry.
    This part, though:
    Now apply your long, animal-modeling, expressions to this new, interposing, table rather than the original.
    may still leave several references to be change from the original data table to the new one.
    One way to get around that is to use the Duplicate ("DATA-1) as the new table for raw data, and the Original (DATA) as the interposing table, using the formula =MAX(DATA-1::A2) as above, starting in DATA::A2.
    This way, the long expressions could continue to reference the original table (with its content now modified).
    ALTERNATE process:
    Find/Replace could also be used to speed the process of reassigning the modeling expressions to the duplicate table, as suggested by Jerry. But some cautions apply here.
    Find/Replace can be limited to Formulas only, but not to Some formulas only.
    Find/Replace can be limited to the Current Sheet only, but this can't be combined with Formulas only.
    More on this later, when I've had a chance to check some possibilities.
    Regards,
    Barry

  • Select returns negative values for unsigned datatypes in MySQL DB

    Hi, I have a table in a MySQL database where some fields are declared as "unsigned".
    Example:
    CREATE TABLE countries (
    Country_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    Number SMALLINT UNSIGNED NOT NULL
    My problem is when inside a .xsql file, I try to do a select:
    <xsql:query>
    select Number from countries where Country_id="15"
    </xsql:query>
    If inside the Database, Number always goes from 0 to 65535 (UNSIGNED SMALLINT),
    the resulting XML of that query will always show negative values if Number is
    bigger than 32767 (so it ignores the "UNSIGNED").
    Have you seen something like this before? Do you kwno what I'm doing wrong or what
    can I do to retrieve the values unsigned?
    Thanks a lot!
    David

    hi muneer
    >
    We are facing a strange issue in our R12.1.3 Ebiz instance (DB 11.2.0.1) - Solaris Sparc 64 bit - 2 node (1 node Apps, 1 node DB).
    Some of the purchase orders are having a negative purchase order number.
    SQL> select segment1 from PO_HEADERS_ALL where segment1 < '0';
    SEGMENT1
    -7951814
    -8960847please see
    Error: Purchase Order Creation Could Not Be Initiated, But PO Was Created With Negative PO Number And No Distributions [ID 789464.1]     To Bottom     
    PO Creation Process Failed In Sourcing And Creates Document With Negative Numbers [ID 1479616.1]
    Purchase Order Receipt FAQ (P4312) [ID 1306869.1]
    How it could happen. Any suggestions please !looks like a bug
    Can a Purchase Order (PO) Be Created With Negative Quantity or Price? [ID 241389.1]
    AppsMasti
    Sharing is caring

  • Input Negative values in selection screen  for select-options field

    I am not able enter negative values for
    SELECT-OPTIONS V_ERFMG FOR MSEG-ERFMG.
    It says negative values are not allowed but I need to check for negative values. Kindly provide me solution.

    You can't put the negative values here...because the Domain which is attached to MSEG-ERFMG has not the "Sign" checkbox on.
    Try with this code:
    tables:wbrp.
    SELECT-OPTIONS V_ERFMG FOR WBRP-menge.
    Regards,
    Naimesh Patel

  • How to fetch negative sign data using select statement

    hi gurus,,
                  i hv  to fetch data which is negative in nature  using select statement i m using ppdit table and wrbtr field.(it contains both negative and positive data)....wat sud i add with select statement...plz help me..
    thnx in advance
    Message was edited by:

    HI,
               I think you can use LT or < 0.0 in the WHERE clause to get all the -ve values. Once you get them treat them as negative.
    Regards,
    Sesh

  • How can I deal with negative marking in a quiz marking scheme?

    I wonder if anyone can help me with a problem I have in developing the 'code' for a marking scheme for an exam in Captivate 8. I would be very grateful for pointers towards a viable solution. At the moment I am just thrashing around.
    My background is in C++ and I think part of my problem is in trying to find analogues of functions I would use in that environment. My experience with Captivate is limited to developing fairly simple training courses but now I need to put an existing exam on line, maintaining its relatively complicated marking scheme, which is as follows:
    The paper is multiple choice, each question having four statements, one (or at the most two) of which is true. A completely correct answer gets 4 marks so where there are two correct statements each gets 2 marks. So far, so easy.
    The difficulty arises from an element of negative marking. If 3 or more statements are selected, the score is 0 marks. If there is a single correct statement and it and an incorrect statement are selected, the score is 2 marks. If there are 2 correct statements and one of them is selected, the score is 2 marks. If an incorrect statement is selected as well, the score is 1 mark.
    I had assumed I could use conditional logic and user variables on a slide-by-slide basis to provide a score value and then assign it to the appropriate system quiz variable, but it seems I can't assign values to variables in a quiz slide. That would have been too easy...
    So, can anybody advise me on an approach that keeps the advantages of using the quiz framework, including the use of the Review function?
    Any help very gratefully received.

    If you use SCORM 1.2 for reporting, negative scores will be converted to zero, because it doesn't allow negative score.
    If you want to keep to Review functionality, you need to stay with the default question slides. There are some tweaking possibilities but changing the score is not one of them.
    Question Question Slides in Captivate - Captivate blog
    Question Question Slides - Part 2 - Captivate blog
    I think the only possible way is to use JS, but then you'll not be able to keep the functionality of the Question slides, you are in custom question slides. Plenty of examples of custom questions can be found on my blog as well.

  • A better way to differentiate positive vs. negative numbers and sum them ?

    Hi, I wonder if there is a better or easier way to differentiate the positive numbers from negative ones and sum them respectively?
    I come up with below:
    create table t1 (num number, id varchar2(3));
    insert into t1 values  (-100, 1);
    insert into t1 values (50, 2);
    insert into t1 values  (-10, 3);
    insert into t1 values  (-20, 4);
    insert into t1 values  (50, 5);
    insert into t1 values  (60, 6);
    select sum(decode(sign(num), 1, num, 0)) plus, sum(decode (sign(num), -1, num, 0)) minu from t1;
    PLUS   MINU
    160     -130Any suggestion would be appreciated! Thanks

    if there is a better or easier way to differentiate the positive numbers from negative ones and sum them respectively?Maybe you want them in different rows than in different columns:
    SQL> select sign(num), sum(num) from t1 group by sign(num)
    SIGN(NUM)   SUM(NUM)
             1        160
            -1       -130
    2 rows selected.?

Maybe you are looking for

  • Unable to install Itunes 10.1 or 10.1.1  -Apple Mobile Device USB Driver

    Unable to install Itunes 10.1 or 10.1.1 and have it sucesfully install the Apple Mobile Device USB Driver. It keeps coming up with an error that the driver is unsigned or disappears completely from device manager. I have tried full uninstall includin

  • Colour should be different

    Hi I created a web dynpro application.In that i created labels,input fields,dropdown ,checkbox...... My question is how we can change the colour Example :  Label-----Inputfield Label must be different color,,Input field must be diferent color. Please

  • Efficient way of calling DB functions in OBIEE

    Hi All, I am using version 11.1.1.5 In a particular requirement, I am calling a DB function to fetch a value based on certain inputs for a Column in the analysis. This Column serves as the Input to another column in the same analysis. This new column

  • Problems in displaying an Image in PDF Form

    hi, I have to display a photo in the PDF form dynamically, hence i have a used an element of type <b>Image Field</b>, where the URL has to be passed to fetch the photo from the location. though all the bindings has been done, the photo is not display

  • AirDrop not seen on both computers

    I'm running a mid 2010 iMac with Mountain Lion installed.  My wife has an iMac (2011) in the basement, running Lion.   We both open our airdrop folders.  She sees my computer and can send me a file.  I see the file come in and see her picture in my a