How to select data that is not there

Table : Details
Columns : 2
prj1 | empA | R
prj1 | empB | D
prj2 | empC | R
prj2 | empD | D
prj3 | empE | R
prj4 | empF | R
prj4 | empG | D
Table:Project
Columns : 4
prj1 | title1 | start1 | end1
prj2 | title2 | start2 | end2
prj3 | title3 | start3 | end3
prj4 | title4 | start4 | end4
SQL
SELECT prj.column1, prj.column2, prj.column3, dtl.column2, dtl2.column2
FROM project prj, details dtl, details dtl2
WHERE (prj.column1 = dtl.column1AND dtl.column3='R')
AND (prj.column1=dtl2.column1 and dtl2.column3='I')
I am using TOAD for oracle to insert from the source to the staging table and then to the fact table in the data warehouse.
A project has 1 requester and 1 developer.
Some projects have requester but have yet a developer assigned to it.
The sql that I use cannot recognize the missing row.
The code cannot work because project 3 will be ignored. Anyone's help is very much appreciated.
Chris.
Message was edited by:
user462899

SELECT prj.column1, prj.column2, prj.column3,
(SELECT column2 FROM details
WHERE column1 = prj.column1
AND column2 = 'R') AS "R_Value",
(SELECT column2 FROM details
WHERE column1 = prj.column1
AND column2 = 'D') AS "D_Value"
FROM project prj
Anna

Similar Messages

  • How do I search for data that's not there?

    Scenario:
    The store managers are supposed to upload the previous days data by 11am the following day.
    I have a table of stores (74 records, 1 for each store) and a table of events (3600+ records,1 for each store per day). When I look at the event data selecting a specific date, I can see I only have 71 records, but I can't easily tell which stores are missing.  I want to gather all the events for a date, then look for the store records and report only if the store is NOT there.  I have tried the following linking options:
    store.store_no (equal to link) event.store_no (gives all 71 event records, as expected, but not the ones that aren't there)
    store.store_no (not equal to link) event.store_no (gives all 71 event records, for each store record, store1, event 1, store1, event2, store2, event1, stove2, event2, etc) I believe this is because it's looking for the store match first, not the date, then the store)
    store.store_no (left outer join) event.store_no (gives all 71 event records, as expected, but not the ones that aren't there at the bottom, like the help states)
    I thought of subreport too, but you can't like on what's not there.
    does anybody have any clues?
    BTW, I'm using 8.5 but can change to 10.
    Thanks,
    Clare

    Carl,
    Thanks so much. I took we a while to get the formatting correct, here's what I ended up with:
    SELECT
        store."store_number", store."address1"
    FROM
        "sac"."store" LEFT OUTER JOIN (SELECT * from "sac"."posj_event"  WHERE  posj_event."business_date" = {d '2009-07-08'} ) ev  ON store."store_number"=ev."store"   
    WHERE
        ev."store" is null
    ORDER BY
        store."store_number" ASC
    My original report was set to look for CurrentDate-1, which translated to {d '2009-07-08'} will that still work here?
    Clare

  • HT4623 how to retrieve data that was not backed up

    SOS!  Being a novice SmartPhone consumer, I tried to safeguard my data on my iPhone 4 only to lose all the data from the date of purchase, is there any way possible that the data (pictures and contacts) are not a total eternal lose? 
    Signed,
    Disperate in Cali

    mpg320 wrote:
    Today I completed a software update for my iPhone 5 without backing it up because I did not receive a warning that all my data would be erased and so, did not realize it would be an issue. Upon completing the update, I realized my mistake but figured it was too late to revert the damage and continued with the restoration of my phone to its factory settings.
    After completing the update, I realized just how much data was lost (including important notes with financial information and images and videos of recent trips around Europe). Now I am desperate to try to recover the data deleted in the update. Is there any chance at all that I can recover something? The notes and videos are most important to me. I am also missing many Messages but that is less important to me.
    Can anyone please help?
    Any response is greatly appreciated!
    Here's the official article from Apple on how to update your iOS.
    Update the iOS software on your iPhone, iPad, and iPod touch - Apple Support
    Before you update
    Back up your device to iCloud or iTunes.
    That's virtually the very first thing it says to do.
    There's no excuse to not have your data backed up prior to updating.  Tell me, what would you have done if, instead of this being an issue where you updated your iOS and had an error, if instead you had dropped your iPhone and it was damaged beyond repair, or if it was stolen or lost, etcetera.
    Perhaps you'd been backing up to iCloud and didn't realize it?  Maybe the missing Notes data is linked to a Mail account?  You might be able to reconstruct the data, but it's going to be an uphill battle.
    Best of luck.  Make sure to backup more frequently in the future.  There are two types of people in the world; those who have lost data, and those that will lose data.  The only difference is how prepared you are for that event.

  • Reporting on data that is not there

    Hi,
    I have an infoprovider and a Query. I have created a variable to filter data from the query. Is there a way to report that some data is not there??
    If I enter value "123" in the CODE variable, and there is no record according to this, the system will say "no data found". Is there any way to get the system to say "True"/"False" wether this found some records or not?
    EJ.
    CODE/DATE
    123/200701
    124/200701
    125/200701
    If I enter "124" in the CODE variable, the system will say "True".
    If I enter "987" in the CODE variable, the system will say "False".
    Is this possible??
    thanks for the help.
    Mauricio.

    Dear Mauricio,
    The usual way to report on "non existing data" is to set up a MultiCube which combines your InfoCube and the InfoObject for which you miss records in the InfoCube.
    A query based on such a MultiCube will give you empty key figure values for all records for which InfoObject values do not correspond with an InfoCube records.
    As far as I know there is no way to adapt the variable screen logic, which would allow to see "True" or "False" there.
    Geetings,
    Stefan

  • Clean-up all data that did not match with the selection.

    Hi Everyone,
    In my requirement I need to  Clean-up all data that did not match with the selection from my internal table lt_cdpos.....in this case wat can i use like.'Refresh' or ' Clear' or 'DELETE ADJACENT DUPLICATES FROM lt_cdpos'.
    Pls suggest me...

    Hi Meenakshi
    Try  delete lt_cdpos where kunnr  NE KUNNR (from selection screen) .
    Before Checking <condition> make sure both comparing field type match with each other.
    You can use FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' for append leading zeros in compare condition before comparing kunnr from selection screen
    Regards
    Parveen

  • How to select data from one nested table and into another nested table

    create or replace
    TYPE ctxt_code_rec as object
    ctxt_header varchar2(10),
    header_description varchar2(300),
    status varchar2(30),
    adjacent_code varchar2(300),
    adjacent_desc Varchar2(400),
    adjacent_flag varchar2(4000),
    adjacent_text_href varchar2(4000)
    create or replace
    type ctxt_code_table as table of CTXT_CODE_REC
    d_table ctxt_code_table ;
    v_tab ctxt_code_table ;
    Iam trying to select data from d_table to v_tab
    using and bulk collect into
    select m.*
    bulk collect into p_code_result
    from table(l_loop_diag_code_table1)m
    order by 1;
    Receiving error:
    ora 94007 : not enoughvalues
    Could you please let me know how to solve it?
    Thanks,
    in advance

    >
    create or replace
    TYPE ctxt_code_rec as object
    ctxt_header varchar2(10),
    header_description varchar2(300),
    status varchar2(30),
    adjacent_code varchar2(300),
    adjacent_desc Varchar2(400),
    adjacent_flag varchar2(4000),
    adjacent_text_href varchar2(4000)
    create or replace
    type ctxt_code_table as table of CTXT_CODE_REC
    d_table ctxt_code_table ;
    v_tab ctxt_code_table ;
    Iam trying to select data from d_table to v_tab
    using and bulk collect into
    select m.*
    bulk collect into p_code_result
    from table(l_loop_diag_code_table1)m
    order by 1;
    Receiving error:
    ora 94007 : not enoughvalues
    Could you please let me know how to solve it?
    >
    Not unless you provide the code you are actually using.
    There is no definition of 'p_code_result' in your post and you say you 'trying to select data from d_table' but there is no code that loads 'd_table' in what you posted.
    And the SELECT query you posted actuall selects from an object named 'l_loop_idag_code_table1' which isn't mentioned in your code.
    Post the actual code you are using and all of the structures being used.
    Also explain why you even need to use nested tables and PL/SQL for whatever it is you are really doing.

  • How to select data from a table by passing document number from another tab

    How to select data from a table by passing document number from another table.
    for eg:-
    I want to display name, adres, region from ADRC table
    by using field delivery document number
    Kind Regards,
    Shanbagavalli.S

    Hi Shanbagavalli,
    There are multiple solutions to this questions a few i will try to answer and then you can take the best required for your requirements.
    **Consider that you have a Internal table having document number from other table..
    SELECT NAME ADRES REGION FROM ADRC
           INTO IT_ADRC
           FOR ALL ENTRIES IN IT_DOC
           WHERE DOCUMENT_NO = IT_DOC-DOCUMENT_NO.
    **Consider that you have 1 document number then
    SELECT NAME ADRES REGION FROM ADRC
         INTO IT_ADRC
         WHERE DOCUMENT_NO = W_DOCUMENT_NO.
    Hope this solves your problem.
    Regards,
    Kunjal

  • How to select data from cluster table

    hi experts,
                   I have a report which picks data from bseg (cluster table ) for a month report it is taking around 4 minutes to process.I feel it is not good when take the report after some months.
    how to select data from these table???how to declare itab for these cluster tables????can we include any search condition or any other kind of internal table???
    please advice.
    mani

    Hi Manikandan,
    The following code may be helpful to understand how to select the data from cluster table.
    Types: Begin of ty_kna1,
    Kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_kna1,
    begin of ty_bseg,
    belnr type bseg-belnr,
    kunnr type bseg-kunnr,
    end of ty_bseg,
    begin of ty_final,
    belnr type bseg-belnr,
    kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_final.
    Data: it_kna1 type table of ty_kna1,
    wa_kna1 type ty_kna1,
    it_bseg type table of ty_bseg,
    wa_bseg type ty_bseg,
    it_final type table of ty_final,
    wa_final type ty_final.
    Select kunnr adrnr from kna1 into table it_kna1 where....
    if sy-subrc = 0.
    select belnr kunnr into table it_bseg for all entries in it_kna1 where kunnr = it_kna1-kunnr.
    endif.
    sort it_kna1 by kunnr.
    Loop at it_bseg into wa_bseg.
    move wa_bseg-belnr to wa_final-belnr.
    read table it_kna1 into wa_kna1 with kunnr = wa_bseg-kunnr binary search.
    if sy-subrc = 0.
    move: wa_kna1-kunnr to wa_final-kunnr,
    wa_kna1-belnr to wa_final-belnr.
    endif.
    append wa_final to it_final.
    clear wa_final.
    endloop.
    Loop at it_final into wa_final.
    write: / wa_final-belnr, wa_final-kunnr, wa_final-adrnr.
    endloop.
    Reward if useful.
    Thankyou,
    Regards.

  • How to select date while Updating record

    I Have created Validation through user api hook on Performance Management Module.but when user enter objective ,if is greater then or less then hundred then system raise error as per policy,but when user enter another objective to meet 100 percent then system raise error "hr object lock " because i am using select statement to sum of that object ,any body idea how to select date while inserting or updating any record.
    Thansks.

    Hi,
    drag and drop a af:convertDateTime on top of the select inputDate component
    <h:form>
    <af:selectInputDate label="Label 1">
    <af:convertDateTime pattern="yyyy-MM-dd hh:mm"/>
    </af:selectInputDate>
    </h:form>
    This adds the current time to the selected dat. In JDeveloper 11 you will be able to explicitly change the time in the calendar
    Frank

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • How to select data from structure

    how to select data from structure

    Hi Laxman,
    Structure holds single record of data. You can acess data by using the syntax <b>Structure-field</b>
    Please see sample.
    data: wa_mara  type mara.
    select *
              from  mara
              into wa_mara
              up to 1 rows.
    endselect.
    write:/ wa_mara-mandt,
             wa_mara-matnr,
             wa_mara-maktl.
    if helps plz reward points.
    Regards
    Bhupal Reddy

  • How to select data from Maintance View in Program

    Dear All ,
    How to select data from Maintance View V_T052 in abap Program.
    Regards,
    Archana

    TABLES: t179, t179t.
    DATA: v_t179_int TYPE TABLE OF v_t179.
    SELECT * FROM t179
      JOIN t179t ON
        t179prodh = t179tprodh
      INTO CORRESPONDING FIELDS OF TABLE v_t179_int.
    Reward points...

  • How to buy apps that are not availble in my region?

    How to buy apps that are not availble in my region?

    No.
    you can ONLY use the itunes store of your country of residence (proven by the issuing country of your credit card and the valid billing address of that card) and ONLY while you are physically located inside the borders of that country.

  • Error while TRANSFER System is trying to write data that were not locked

    Hi Everybody,
          I am encountering a Error Msg when i try to TRANSFER plan values .The Error masg is
    "System is trying to write data that were not locked".
    I never got this msg before. I checked my Planning query, it looks fine. I have the cells in Blue but couldn't change values or create new records.
    I have the locks set up in RSPLSE too.
    I am on BI-7 IP SP12.
    regards,
    Roger

    Hi ,
      Below is the reply i got from SAP this morning... i have asked my basis team to apply the note.. will update after i test my layout.
    *************Reply from SAP *********************
    I was able to replicate the issue in your system.
    Please implement the note 1153756 in your system.
    1153756 : Template: BI 7.0 (SP18) / BI 7.1 SPS06
    This note will solve your issue.
    If the issue still persists then , please try using a blank value for
    RSADMIN parameter RSPLS_DATA_CHECK_WRITE = X.
    This parameter triggers some 'extra' checks.
    Using a blank value should avoid these error message which you are
    getting.
    regards,
    roger

  • How to compare two dates that should not exceed morethan 3 years

    hi all,
    can you please tell me how to compare two dates( basically dates are string type)
    that should not exceed more than 3 years? in JAVASCRIPT
    Thanks in Advance.

    This is not a JavaScript forum.
    [*Google* JavaScript Forum|http://www.google.co.uk/search?q=JavaScript+Forum&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a]
    Good luck.

Maybe you are looking for

  • Hard Disk - Mac OS Boot Volume failure

    Hello everyone, My Mac does not boot. I started having odd problems of clicking on a document and the mac refusing to open its application (tried with PDF, DOCX, even JPG). When I rebooted I was  greeted with a a normal grey screen with apple logo an

  • Unable to send messages

    since updating to iOS 7, several of my text messages have not been sent.  They do not show as undelivered unless I power off/on my phone.

  • Quicktime help!

    I keep seeing the quicktime symbol with a question mark in the middle, whenever I try to watch a video. Why am I getting this???????

  • Deleting service tickets and BW impacts

    Der experts, I'd like to delete "dummy" service tickets in our production system. These service tickets shouldn't appear in the BW system. From my understanding, the best way is to use the report CRM_ORDER_DELETE. Could you confirm that this report w

  • Re: Premium Account not working?

    I have Premium so I can video conference once a week with colleagues. For the first time today we couldn't get everyone on video and we kept getting ads popping up for Premium, even though I have already purchased it. Tbh I'm pretty miffed that I'm p