Joining 2 tables, all data from 1, data from 2 only when condition on 1 met

I am joining two tables on a single column, JOB_ID.
There is a one to many relationship between table1 and table2.
I want to report all rows from table1 (subject to criteria)
and all rows from table2 for the relevant JOB_ID but ONLY if a condition on table1 is met, ie table1.status != 'Ready'
I am using the join
table1.JOB_ID=table2.JOB_ID(+)
I tried
table1.JOB_ID=decode(table1.status,'Ready',-1,table2.JOB_ID)(+)
I use -1 because it will never exist, hoping to mean the join fails but with (+) will mean I still get the value from table1.
However, it runs "forever"
Any suggestions, please?

hi,
I didn't understand exectly what you need but, have you tried this;
select .. from table1 left join (table2) on ( table1.JOB_ID=table2.JOB_ID and table1.status != 'Ready')
Best Regards...
efe

Similar Messages

  • My iphone 3g wont load all comments from online newspaper. when I touch the "load more comments" button the little spinning spiral appears then nothing happens. Anyone else have this problem with some online newspapers?

    My iphone 3g wont load all comments from online newspaper. when I touch the "load more comments" button the little spinning spiral appears then nothing happens. Anyone else have this problem with some online newspapers?

    Anything?

  • How can I prevent all workbooks from opening automatically when Excel starts?

    I am using Office 2011 (14.2.1) service pack 2 on Mac os X 10.7.3. Whenever I open Excel, all my workbooks open.  How can I prevent all workbooks from opening automatically when Excel starts?
    Please Help, Thanks

    You can look at: Stop Autoplay: https://addons.mozilla.org/firefox/addon/1765

  • Have a 27 imac desktop with mac osx 10.5.8, finally got out of grey and black screens etc. is there anything I can do to prevent all this from happening again when I shut down?

    Have a 27 imac desktop with mac osx 10.5.8, finally got out of grey and black screens etc. is there anything I can do to prevent all this from happening again when I shut down? Or before I shutdown? TIA.

    Basic Backup
    For some people Time Machine will be more than adequate. Time Machine is part of OS X. There are two components:
    1. A Time Machine preferences panel as part of System Preferences;
    2. A Time Machine application located in the Applications folder. It is
         used to manage backups and to restore backups. Time Machine
         requires a backup drive that is at least twice the capacity of the
         drive being backed up.
    Alternatively, get an external drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
      1. Carbon Copy Cloner
      2. Get Backup
      3. Deja Vu
      4. SuperDuper!
      5. Synk Pro
      6. Tri-Backup
    Visit The XLab FAQs and read the FAQ on backup and restore.  Also read How to Back Up and Restore Your Files. For help with using Time Machine visit Pondini's Time Machine FAQ for help with all things Time Machine.
    Although you can buy a complete external drive system, you can also put one together if you are so inclined.  It's relatively easy and only requires a Phillips head screwdriver (typically.)  You can purchase hard drives separately.  This gives you an opportunity to shop for the best prices on a hard drive of your choice.  Reliable brands include Seagate, Hitachi, Western Digital, Toshiba, and Fujitsu.  You can find reviews and benchmarks on many drives at Storage Review.
    Enclosures for FireWire and USB are readily available.  You can find only FireWire enclosures, only USB enclosures, and enclosures that feature multiple ports.  I would stress getting enclosures that use the Oxford chipsets especially for Firewire drives (911, 921, 922, for example.)  You can find enclosures at places such as;
      1. Cool Drives
      2. OWC
      3. WiebeTech
      4. Firewire Direct
      5. California Drives
      6. NewEgg
    All you need do is remove a case cover, mount the hard drive in the enclosure and connect the cables, then re-attach the case cover.  Usually the only tool required is a small or medium Phillips screwdriver.

  • XML PO is getting released from SRM only when Repeat Output is performed

    Dear Experts,
    Extended Classic Scenario(SRM-XI-SUS) inwhich SRM and SUS have on same SRM Server 7.0 but with differentt clients.
    XML communication is being happened between SRM and SUS.
    PO is created and ordered from SRM but it is releasing to SUS only when Purchaser in portal  is performed  Repeat Output manually or can say "Process for  BBP_PO_SEND_XML Is Started" only when we click Repeat Output button by purchaser in portal login.
    Replicating Steps :
    1. Create shopping cart by Employee, Approve by Manager and PO is created(for say : 21111).
    2. Open PO (21111) by Purchaser Login.
    3. Go to Header Tab then Output sub tab.
    4. Then i have to click Repeat Output button then only "Processing BBP_PO_SEND_XML Badi Is Started"  otherwise not.
    Thanks in advance.
    Regards,
    Pawan Keshwani

    Hi,
    Thanks for your reply.
    I have configured  Application Control Workflow correctly ( I am using Workflow without approvals for PO (BUS2201))
    And in Rz20, I am getting below messege ("SHD : MTE class BBP_PO , Client 901 : No MTEs currently available*) for PO in Rz20 given below path
    (CCMS  monitor sets -> SAP (CEN) EnterpriseBuyer Monitors -> Purchase Order)
    I am configured ESOA Architecture in XI  for SRM-SUS , and my root issue is " I am not able to generate XML messeges in SRM".
    Not getting any messege in SXMB_MONI in SRM.
    Regards,
    Pawan Keshwani

  • Correlated Subquery for joining summary table original data table

    I want to list a set of fields from an inner-query that correspond to calculated fields on an outer-query. A set of date fields on the outer-query signify a range to correlate records on the inner-query. Records on the inner-query have a single date field
    which should fall within the outer-query date range. At this point, I cannot determined the correct syntax for this query, but am able to achieve the desired results using a left outer join and case-when arguments on what should be the inner-query records.
    Here's my basic SQL right now:
    SELECT  DISTINCT a.service,
          a.start_range,   -- start of month
          a.end_range,    -- end of month
          a.availability,
          CASE WHEN YEAR(a.start)=YEAR(o.begin) AND MONTH(a.start)=month(o.begin) THEN o.event_id ELSE NULL END AS 'event_id'
    CASE WHEN YEAR(a.start)=YEAR(o.begin) AND MONTH(a.start)=month(o.begin) THEN o.minutes ELSE NULL END AS 'minutes'
    FROM   service_availability a LEFT OUTER JOIN 
               service_outage o ON 
    a.service=o.service AND
    TIMESTAMPDIFF(YEAR,o.begin,NOW())=0
    WHERE   TIMESTAMPDIFF(YEAR,a.start,NOW())=0
    The limitation with this approach is that the CASE WHEN argument needs to be used for retrieving any fields on the service_outage table. I've tried several approaches including parameters in both the FROM and
    WHERE clauses as well as subqueries, but cannot get any to return the data. Is there a better way to achieve this?

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your datA. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal datA. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL.
    >> I want to list a set of fields[sic] from an inner-query that correspond to calculated fields [sic] on an outer-query. <<
    Columns are not fields. Rows are not records. CASE is an expression, not an argument. Where did you get the terms “inner-query” and “outer-query”? I never heard them before and I have some experience with SQL. We have subqueries; is that what you are trying
    say? 
    >> A set of date fields [sic] on the outer-query signify a range to correlate records [sic] on the inner-query. Records on the inner-query have a single date field [sic] which should fall within the outer-query date range.<<
    You do not know the basic terms or how SQL work. You also posted some weird dialect of an SQL-like language. What is NOW()?? Does that mean CURRENT_TIMESTAMP in your dialect?  Did you know that BEGIN is a reserved word in SQL? 
    >> At this point, I cannot determined the correct syntax for this query, but am able to achieve the desired results using a LEFT OUTER JOIN and CASE-when arguments [sic] on what should be the inner-query [sic] records [sic]. Here's my basic SQL right
    now: <<
    Why are you doing temporal math in SQL? Where is the calendar and report period tables?
    Since SQL is a database language, we prefer to do look ups and not calculations. They can be optimized while temporal math messes up optimization. A useful idiom is a report period calendar that everyone uses so there is no way to get disagreements in the DML.
    The report period table gives a name to a range of dates that is common to the entire enterprise. 
    CREATE TABLE Month_Periods
    (month_name CHAR(10) NOT NULL PRIMARY KEY
      CHECK (month_name LIKE '[12][0-9][0-9][0-9]-[01][0-9]-00'),
     month_start_date DATE NOT NULL,
     month_end_date DATE NOT NULL,
     CONSTRAINT date_ordering
      CHECK (month_start_date <= month_end_date),
    etc);
    These report periods can overlap or have gaps. I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The advantages are that it will sort with the ISO-8601
    data format required by Standard SQL and it is language independent. The pattern for validation is '[12][0-9][0-9][0-9]-00-00' and '[12][0-9][0-9][0-9]-[01][0-9]-00'
    Why is an outage not an availability status or an event? 
    >> The limitation with this approach is that the CASE WHEN argument [sic] needs to be used for retrieving [sic: querying is not retrieving] any fields [sic] on the Service_Outage table<<
    We have no DDL! Not even sample data. 
    >> I've tried several approaches including parameters in both the FROM and WHERE clauses as well as subqueries, but cannot get any to return the data. <<
    Parameters exist in procedure declarations; arguments are the actual values passed in them.  Neither of them as anything to do with a query. 
    Want to try again? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Unplugged Ipod accidentally, caused all data to not show when reconnected

    I accidentally disconnected my Ipod (knocked the cable)this wasn't done during a actual transfer. But when reconnected none of my songs,video or play list show up on the ipod, both when connected to the PC (software) or not. I've done a reset on the ipod and restarted the software (pc) run a disk error check....... HELP............. the drive shows theres 24gigs used. How do you fix/restore the file system on the ipod..... any Help would greatly be appreciated.

    See: How to restore the iPod to factory settings.
    After that, reload the music from iTunes.

  • I AM USING PREM PRO CC2014 AND LOSING ALL SAVES FROM THE PROJECT WHEN i EXIT AND LATER OPEN UP PPRO

    I am at wits end as to why three times i have lost all saved info from a Premier Pro cc 2014 project.
    If I exit Prem pro and come back later, reopen the project , all I get is the old project with no saves, all changes (hours worth) absolutely $#@#$* gone.
    This is the third time !!!! I updated Prem pro about two weeks ago. Have not done any editing since the update,  start of this week, now having major problems.
    I save the work constantly, Is anyone having similar issues as this has never happened before 

    Make a new project and import old one into this new one.
    See if you can find a up to date Auto Save.
    Also make a habit of 'Save A Copy' to a different drive after each edit session. Save A Copy does not overwrite after so many times as Auto Save does.

  • Retrieve all values from project type when project type combo box is null

    Hi,
    We are facing a tight situation here. We have a scenario where we have 2 filter options.
    1) Department ID
    2) Project type
    When department ID is selected all the department IDs should be populated in the combo box and the project type combo box should be empty.
    Similarly, when project type is selected all the project types should be populated in the combo box and the department ID combo box should be empty.
    Then, when more than one value is selected from department ID box and all the values from project type must be retrieved from query level (as per business logic).
    How do we do this? Kindly help us with this situation.

    Basically my situation slightly different.
    I am trying to do a bulk insert on SQL Server table using prepared statement, during that time i am getting the exception. I am using JDBC-ODBC driver. However, if i do individual record insertion, it is working.
    Any idea about this type of problem ?
    Regards
    Ramesh

  • How do you stop all devices from going off when one is being called?

    After most recent update for apple, all my devices are going off at the same time when only one is where the call is gong to. I have 2 iPhones, 3 iPads and an iPad mini and one newer iPod. Is there a way to stop this? It is kind of a pain.

    Go to Settings > FaceTime and turn "iPhone Cellular Calls" to off on each device. It is a feature of Continuity: Connect your iPhone, iPad, iPod touch, and Mac using Continuity - Apple Support

  • Data is not showing when condition is applied

    Hi All,
    I have a small query. Am trying to use a if condition to achive the following:
    If the Exchange rate is 1, then I need to concatinate the revenue field with $.
    And if it is not, then concatinate it with #. Exchange rate is another column in the same group.
    I tried using the following:
    <?xdofx:if Petrofac-PTSExchangeRate=1 then concat('$',Revenue)
    else concat('#',Revenue) end if?>
    But it is not showing me any result in the revenue column.
    Any Ideas?
    Thanks in advance,
    Imtiaz.

    Use xdoxslt functions instead.
    <?xdoxslt:ifelse(Petrofac-PTSExchangeRate='1',concat('$',Petrofac-USDXRate),concat('#',Petrofac-USDXRate))?>

  • How do I stop ALL tabs from going dim when Firefox is not the active WINDOW?

    I think I have read every single post about changing active tab colors, etc, etc. However, where I am frustrated seems to be a little different.
    When Firefox 31 is not the active WINDOW the whole tab bar goes grey (just like the title bar) and the only tab I can read the title of is the active tab. I need to be able to see ALL tab names.
    I don't want to use any add-ons. I just want a simple userChrome.css or about:config option. I have other UI complaints, but this is the only one I care enough about to do anything about. It is making me less efficient, confused, and frustrated.
    Can anyone please help?

    That's good to hear. Good work. Please go to your last post and
    flag it as '''Solved the problem''' so others will know what to do.
    Also, if you want help for the other issues you spoke of,
    Just ask. Good day.

  • I have 4.2.1 ipod and can't get it to sync all songs from computer, only 110 songs, help

    I have an older ipod 4.2.1, I can only sync 110 songs from my computer itunes.  Help!

    Hello CnkinHa
    Start with the restoring your iPod and then trying the sync again. You will also want to make sure that your iTunes is authorized to play any purchase content.
    Restoring iPod to factory settings
    http://support.apple.com/kb/HT1339
    Authorize your computer using iTunes
    http://support.apple.com/kb/HT1420
    Regards,
    -Norm G.

  • I just updated my iphone to ios5 now when i go to music it says 'no content' when i checked my capacity it shows 7.9gb in 'other' . i can also see all my music is on the 'device' only when i go on the computer

    i just updated my iphone to ios5 now when i go to music it says 'no content' when i checked my capacity it shows 7.9gb in 'other' . i can also see all my music and apps on the device menue in itunes.

    I went to the Summary page of iTunes and checked "Sync only checked songs and videos".  Synced again, and no songs were playable.  Unchecked my only playlist and synced again.  All the songs were gone as expected.  Checked my playlist again, and all the songs were there.  Looked at them under the music tab, but they were all grayed out.  Tried to play any of them, but could not.  Tried to sync again and received the message, "The iPhone could not be synced because the sync session failed to start."
    Every time I connect my iPhone 4 to iTunes, it says "iTunes was interrupted while restoring the contents of the iPhone ____.  Would you like to restore this iPhone again now?"  I click "Continue Restore" (I'm tempted to click "delete backup.)  It then says, "An error occurred while restoring this iPhone (-54).  I click OK.  I'm redirected to the "Set up your iPhone screen".  It's already selected to "Restore from backup of ___'s iPhone".  Click continue.  It restores for about 2 minutes.  iTunes says my settings have been restored and wait for it to restart.  And again the message that "iTunes was interrupted..." (see above).  Crap.
    How do i get this back to where it belongs?

  • Modem disconnects from net only when using iPad Mini

    Hi, I'm using TP-Link TD-W8951ND Modem, When I connect my iPad mini to it and start browsing internet or watching videos the modem disconnects from net. This problem doesn't happen when I do the same with my Android phone or laptop. I have reset both iPad and modem without any luck. This is very frustrating for me. Kindly Help!

    this is solved by me
    ill take the solution with me since no one offered any help..
    thanks for all the hard work from black berry online and phone support 

Maybe you are looking for

  • Is there a way to transfer money from one account to another

    please help

  • Help using manifest file classpath.

    I have a jar file (A) that is dependant on another jar file (B). When I run my app, which references jar A, if it doesn't also include jar B in its class path I get an error referencing jar B (as expected) Exception in thread "AWT-EventQueue-0" java.

  • Generating pdf from RoboHelp gives "macro disabled" error

    I'm using RoboHelp 8 -> RoboHelp HTML, and I have MS Word 2007 and "Adobe PDF Creation Add-On 9" installed. To generate a pdf, I navigated to "Single Source Layouts" and double-clicked "Printed Documentation" (File -> Generate -> PDF should be the sa

  • Smartforms & Scripts

    Hai can anybody tell me answers for these Questions...... 1.What is the difference between a script & a report ? 2.What are the components/elements in sap script ? 3.Can you create a script with out a main window ? 4.How many main windows can be crea

  • Cost and Controlling Standard tables

    Please list down the standard SAP tables used in the Controlling and costing module