How to upgrade a selection one line of the table based on values in another table when there is exactly one matching entry and negligence if there is more than a football game

Hello

I'm trying to achieve the following objectives:

1. in table A, select rows based on the values in column 2. something like SELECT * FROM TABLE A WHERE (COLUMN2 = 'X' or Column2 IS NULL)

2 and these values selected, I want to update Column3 from Table A if TableA.column1 = TableB.column1, but only if there is exactly one game. If there are multiple matches, column 3 of the table article updated.

That's what I've tried so far.

UPDATE TABLE_A

SET

TABLE_A.COLUMN3 = (SELECT COLUMN3 OF TABLE_B

WHERE ((TABLE_B.COLUMN1 = TABLE_A.COLUMN1) AND ( TABLE_B.COLUMN1 IN (SELECT Column1 FROM TABLE_B GROUP BY COLUMN1 , HAVING COUNT (*) = 1)))

WHERE EXISTS (SELECT * FROM TABLE_A)

WHERE ((TABLE_A.COLUMN2 = 'X' OU TABLE_A.COLUMN2 = 'Y') AND (TABLE_A.COLUMN4 IS NULL OR TABLE_A.COLUMN4 = ' ')));

More details on my DB environment:

Version Info:

Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

PL/SQL Release 11.2.0.4.0 - Production

Toad, but, depending on whether the query updated all lines. I would really appreciate if someone could tell me how to fix my request.

Thanks in advance.

Exists it predicate in the block of update will be set to true if there is at least one row in table_a where column2 is X or Y and column4 is null or a space. You need to correlate exists it with the outer query query (I'm guessing on column1) to get the result I think you want.  However, who would update all rows in table_a who meets the criteria, there is a corresponding row in table_b, affecting Column3 lines form null not matched or not.  (Again), I'm guessing that's not your intention.  If you only want to update the lines in table_a which have a corresponding line in table_b and meet the other predicate, then I think you want something more like:

Update table_a

Set table_a.column3 = (select column3 of table_b

where table_b.column1 = table_a.column1 and

Table_B.Column1 in (select column1 from table_b

Group by column1, having count (*) = 1))

where ((table_a.column2 = 'X' ou))

table_a.Column2 = 'Y') and

(table_a.column4 is null or)

table_a.column4 = ' ')) and

table_a.Column1 in (select column1 from table_b

Group by column1, having count (*) = 1)

John

Tags: Database

Similar Questions

  • can someone let me know how to print a scanned document. In printing only the 1st page prints fine as I know that there is more than one document.

    can someone let me know how to print a scanned document. In printing only the 1st page prints fine as I know that there is more than one document.  This is the version Adobe photoshop cc 2014.  Someone said it you use printing quick button but who can't find anywhere.

    Carolyn

    Carolyn,

    I don't know if Photoshop is the best solution for the printing of DOCUMENTS scanned.  Photoshop opens a page of a DOCUMENT at a time, let's say you have a MultiPage PDF Document, when you open with the PS, tell him what page you want to open. Once you do, it will convert this page into basically a picture, a raster file that can be edited like a photo.  So if you go to print, it prints only one page, you have open...  So, if you have opened the first page of your document and go to print it, which explains why it only prints the first page.

    So is what file type of the document that you are trying to print?  If it's a PDF file, I opened it with Acrobat/Reader, depending on whether you have and that FILE you > PRINT it like that.   Or is there a particular reason (Lighten/Darken/increase contrast etc...) you are needing to go first to Photoshop?

    Give me a little more information on exactly what you're trying to do and I'll do my best to provide a workflow easier to achieve your final goal.

    I hope this helps.

  • XML with XSD validation when there is more than one XSD.

    Hello

    I need to validate an XML against a set of xsd.

    I am aware that, when there is a single XSD to compare, it is possible to compare using xmlDoc.schemaValidate () with xmlDoc and xmlSchema.

    But in my case, there is more than one XSD against which I need to compare the XML code.

    My main XSD has the statement as mentioned below.

    " < xs: import namespace = ' http://www.w3.org/1999/xxxx "schemaLocation ="xxxx.xsd"/ > "

    " < xs: import namespace = ' http://www.w3.org/1999/02/yyyy "schemaLocation ="yyyy.xsd"/ > "

    I don't know how to handle this situation.

    Please, help me!

    Thank you

    Vicky

    Hi Vicky,

    This situation is not different, just validate the main schema.

    But, to use the XMLType schemaValidate method, you must save the schema in the database (via the DBMS_XMLSCHEMA API).

    If the main schema contains imports then these referenced schemas must be saved too.

    To sum up: register all 3 patterns in their order of dependency, then you will be able to validate your XML with the main XSD code.

    () dbms_xmlschema.registerSchema

    schemaURL-online , for example 'xxxx.xsd'

    schemaDoc =>

    local-online true

    genTypes-online fake

    genTables-online fake

    enableHierarchy-online dbms_xmlschema. ENABLE_HIERARCHY_NONE

    ) ;

  • Why only a single composition plays when there is more than one on a page after you refresh?

    Open Wrapper.html. In it, I have 2 composition (test1 and test2). Both are on autoplay and when I saw everyone on board animate the work very well. It's just when I connect the two compositions in a new document, it gets glitchy. The first charge that both will play, sometimes only plays at halfway. After that updating of the composition that one page plays, the other gets stuck on the first image.

    Dropbox - test.zip

    Is this a bug? How can I do to make the two play normally at the same time?

    Hello

    Files repaired ==> test - 4.zip - box

    You need to clean the panels of your script: the two files.

    Then wrapper.html works well.

    A small error with file wrapper: an only div.

  • When you subscribe to creative Cloud(Photoshop and Lightroom), that come with more than one license, and is it possible to install it on Windows and Apple (if it comes with two licenses)? Thank you.

    When you subscribe to creative Cloud(Photoshop and Lightroom), it does it with more than one license, and if so, is it possible to install on Windows and Apple OX? Thank you.

    A Cloud subscription provides for the installation of facilities to work on both machines.  You can have (Windows and Apple OX) operating systems.

  • ArrayCollection collection only works when there is more than one element.

    Flex 4.6.   XML is generated by php.

    < imgtex >

    < image >

    < pic_no >

    < / pic_no >

    < pic >

    < / pic >

    < tex >

    < / tex >

    < / image >

    < / imgtex >

    When the XML has several lines (pic_no, pic, tex); For example:

    < pic_no > 01 < / pic_no >

    < pic > some.jpg < / pic >

    < tex > text < / tex >

    < pic_no > 02 < / pic_no >

    < pic > some2.jpg < / pic >

    < tex > some Text2 < / tex >

    Control dataGrid and Alert.show () fills this info. But if there is that a single row of (pic_no, pic, tex), the DataGrid remains empty and Alert.show () is not yet displayed.

    Is there something still missing from my code? A single item in the collection ArrayCollection should be treated differently? Thank you.

    Import mx.collections.ArrayCollection;

    [Bindable] private var img:ArrayCollection;

    private void getImgResult(event:ResultEvent):void {}

    IMG = event.result.imgtex.image;

    mx.controls.Alert.show ("img =" + img);

    }

    The example above, I think it would be clearer to do this in your result handler:

    var resultAC:ArrayCollection;

    if (event.result.rows.row is ArrayCollection) {
       
    resultAC= event.result as ArrayCollection;
    }else{
       
    resultAC= new ArrayCollection(ArrayUtil.toArray(event.result));
    }

  • Several feature selection to row in the table

    Hello

    I have a group with the style of layout table and I want to set the the "multiple" generated table rowSelection property but it seems there is no way to do unless you are using the group as LOV, which is not desirable for me to JHs. The following code shows how to set this property in tableGroup.vm:

    #if (! ($JHS.current.group.useAsLov & & $JHS.current.group.multiSelect))
    selectionListener = "#{#BINDINGS_TABLE (). collectionModel.makeCurrent}.
    rowSelection = 'single '.
    #if (! $JHS.current.group.useAsLov)
    selectedRowKeys = ' #{#TABLE_BEAN () .selectedRow} ".
    #end
    #else
    rowSelection = "multiple".
    selectedRowKeys = ' #{#LOV_PAGE_BEAN () .selectedRowKeySet} ".
    selectionListener = "#{#LOV_PAGE_BEAN () .selectionListener}".
    #end

    Is there a reason for not allowing to have several feature selection of line in the table when it is not in mode LOV?

    Thank you
    Will do

    Will do,

    No, but if you want to have multiple selection, there is typically a custom action that you want to apply to selected lines, which cannot be defined in the Jheadstart Application definition editor.
    However, it is perfectly well use a custom template tableGroup.vm and allow multiple selection.

    Steven Davelaar,
    JHeadstart team.

  • How to use the checkbox to select several lines of af: table

    Hi all
    I want to use the checkbox to select several lines of af: table

    Kind regards
    Tom

    Hello

    look at this link
    http://Sameh-Nassar.blogspot.com/2009/12/use-checkbox-for-selecting-multiple.html

    Kind regards
    Felix

  • Selection of lines with the range Paging VO

    Hello

    JDev 11.1.2.4

    I created a VO based on an OA. I added a transitional attribute in the original Version, this attribute is named Selelected of type Boolean initialized to false (default value Expression: false-Expression of Refresh value: false). That VO appears as an af:table. The attribute is displayed as selectBooleanCheckbox. The VO is set with an access mode of range Paging and a size of 28.

    < af:selectBooleanCheckbox value = "#{row.bindings.Selected.inputValue} '"

    label = "#{bindings." VwRhdPortfolioTranWrkSend11.hints.Selected.label}.

    required = "#{bindings." VwRhdPortfolioTranWrkSend11.hints.Selected.mandatory}.

    shortDesc = "#{bindings." VwRhdPortfolioTranWrkSend11.hints.Selected.tooltip}"id ="it1' autoSubmit = 'true '.

    valueChangeListener = "#{pageFlowScope.portfolioTransferBean.onWorkSelection}" >

    < f: validator binding="#{row.bindings.Selected.validator}"/ >

    < / af:selectBooleanCheckbox >

    The table shows the 25 lines. The user clicks one of the checkbox to select a line. The valueChangeListener is called with the new value (auto submit = true) as expected. Then the user scroll down for another "page" in the table, new lines are displayed. Then it scrolls to the first page. The previous selected checkbox is reset as not selected. The selection is lost.

    Is this expected behavior? If so how do you get a selection of lines with a VO of range paging.

    Thank you

    Try to create the transitional attribute in OT instead of VO.

    See you soon

    AJ

  • How can we make a visible element on the screen based on the selection of an existing menu in the same screen

    February 2015 release OPA

    How can we make a visible element on the screen based on the selection of an existing menu in the same screen.

    I have a list box and a text box in the same screen.

    I have a visibility rule on the text box saying that it is only available for one of the selection in the menu dropdown.

    problem is now unless I hit the button next to the screen and return to the original screen the text box does not appear.

    Is there a solution to more to come this problem.

    Please help me

    The feature you describe is called "dynamic visibility" (http://documentation.custhelp.com/euf/assets/devdocs/february2015/PolicyAutomation/en/Default.htm#Guides/Policy%20Modeling%20User%20Guide/Interviews/Screens/Add_questions_to_screens.htm#Dynamic). It allows to control the visibility of another article on the same screen, without writing a separate rule of visibility and click on Submit.

    Using out-of-the-box functionality, you can have dynamic visibility based on Boolean values and value lists (but not regular drop-down lists).

    The example in the February 2015 User Guide based on a Boolean value on the same screen. See slide 27 of the bridge-features and benefits for an example of what it looks like to a list of value: http://www.oracle.com/technetwork/apps-tech/policy-automation/overview/opafeb2015featuresbenefits-2431219.pdf

    If you are wondering what is a list of values, see here: http://documentation.custhelp.com/euf/assets/devdocs/february2015/PolicyAutomation/en/Default.htm#Guides/Policy Modeling User Guide/Value_lists/What_is_a_value_list.htm

    See you soon,.

    Jasmine

  • How to set the text in the last line of the table to be bold

    Hi all

    I have two tables in the report on my page and I would like to have the last line of the table as a "BOLD" text data.

    I found a jQuery selector to select the last row of the table, but I do not know how to implement it in the Apex. I want to control what table will have changed last row and who won't.
    $("tr:last").css({backgroundColor: 'yellow', fontWeight: 'bolder'});
    Could someone help me how to create a dynamic action to accomplish, or if y at - there another solution?

    My test app:

    user name: [email protected]
    passwd: kurintest
    appl: REPORT_APPL 12451

    Thanks in advance,

    Jiri

    Nico Martens wrote:

    PS: If you worry about sql plsql context switching, use a box instead of my function. Which probably could increase performance.

    Using this technique , analytics, and casewould be more effective and offer the best separation of concerns:

    Source report

    select
              product_id
            , sum(quantity_on_hand) qty
            , avg(quantity_on_hand) avg
            , case
                when   count(*) over ()
                     = row_number() over (order by product_id nulls last)
                then
                  'bold'
                else
                  'normal'
              end font_weight
    from
              oehr_inventories
    group by
              rollup(product_id)
    order by
              product_id nulls last
    

    HTML column expression

    #PRODUCT_ID#
    

    Avoid generating HTML in the query when it is possible that its impact on the ability to use the features of declarative report as column sorting and setting in the form. (See examples on page 3)

    If you have a table with 100 rows and you show only 15 lines. Do you want the 15th line "BOLD" or just line 100Le.

    It is really the important issue here. If the reports do not use paging and always show all lines, then it's trivial to implement using dynamic Action (as shown on page 2):
    H4. When

    Event: After refresh
    Selection type: jQuery Selector
    jQuery Selector: .report-standard

    H4. Real Action

    Action: Run the JavaScript Code
    Fire on loading the Page: Yes
    Code:

    $(".report-standard tr:last-child td").css({backgroundColor: 'yellow', fontWeight: 'bolder'});
    

    (Here is to use appropriate DA / jQuery selectors to make sure that only reports including totals get this formatting applied...)

    For more complex presentations, a report of custom line model is the way forward, as in the link in the previous thread of the OP: + {: identifier of the thread = 2436912} +.

    Also note that the columns hidden, based on the GROUP_ID/GROUPING/GROUPING_ID functions are very useful in these reports. They can be used to report conditions of line to avoid the additional conditions to be ready in the query (as in the case above) and provide the break several levels of formatting.

  • How to query start a new line in the column?

    How to query start a new line in the column?

    Exam

    SELECT ID, username | host name, details of xxx;

    on the 2 column, I need result below:

    Username ID | hostname in detail
    1 user1 xxxxxx
    host1
    2 user2 xxxxxx
    host2

    Kind regards
    Suradech

    Something like that?

    SQL> WITH tbl AS (SELECT 1 id,'user1' uname,'xxx' dtl,'host1' hname FROM DUAL UNION ALL
      2               SELECT 2 id,'user2' uname,'yyy' dtl,'host2' hname FROM DUAL UNION ALL
      3               SELECT 3 id,'user3' uname,'zzz' dtl,'host3' hname FROM DUAL
      4               )
      5  SELECT id,uname||dtl||chr(10)||hname FROM tbl;
    
            ID UNAME||DTL||CH
    ---------- --------------
             1 user1xxx
               host1
    
             2 user2yyy
               host2
    
             3 user3zzz
               host3
    
  • Toggle buttons control according to the selected line in the table?

    Hello

    I have used JDev 11.1.1.2.0

    On my main page, it has a query section and view the result to a component of the lookup table and also has functioning as (update/deletion) buttons in the toolbar.

    I want to toggle buttons operating according to some value of the selected line in the table, and I searched on the OTN forum, found more than issues like that, but seemed no found a good solution.

    The table is a unique and has a status column selection, its data type is integer, and I want to activate the buttons when the value of the status field of the selected line is 0 or 1, disable the buttons when the State value is other values.

    Code of the table as:

    < af:table value = "#{bindings." Var VO1.collectionModel}"="row ".
    lines = ' #{bindings. " VO1.rangeSize}.
    emptyText = "#{bindingsVO1.viewable?" '} ". No data to display. ': 'Access Denied. »} »
    fetchSize = "#{bindings." VO1.rangeSize}.
    rowBandingInterval = '0 '.
    filterModel = "#{bindings." VOCriteriaQuery.queryDescriptor}.
    queryListener = ' #{bindings. " VOCriteriaQuery.processQuery}.
    filterVisible = "true" varStatus = "vs."
    selectedRowKeys = ' #{bindings. " VO1.collectionModel.selectedRow}.
    selectionListener = "#{bindings." VO1.collectionModel.makeCurrent}.
    rowSelection = "single" id = "resId1" >

    Operation code buttons like:
    < af:commandToolbarButton text = "Update" id = "ctb2" action = "editDAF" / >

    Any suggestions would be very helpful.

    Thank you
    zeroxin

    Hello

    bind to the attribute in the PageDef file for the status field. Then configure the PartialTriggers property button to point to the ID of the table. Of the disabled button property then points to the status as attribute link

    #{bindings.statusField.inputValue == 'value'}

    Frank

  • How to automatically complete a transitional according to the value of another attribute when attribute line is questioned in the VO?

    Hello world

    The task seems simple enough, but I have not found a way to populate an attribute transitional according to the value of another attribute when the line is queried. What is the best way to achieve this?

    Thank you.

    James

    Use VORowImpl, if you have any transient attributes defined in the view object, whose value is derived from other attributes of the line, you can override the GET method and add logic there

    Please note that this class represents a row in the results collection in a display object.

  • Add lines to the table of results

    Hi all

    A table of results page updated, I have one called submitButton 'Add' to add rows at the bottom of the table to create a new record.
    Wrote a method create in AM, but it's always add a new line to the second last position.

    How to add a new line to the table after the last record?


    Thank you and best regards,
    Patricia

    In your method of AM

    You can use following code in AM

    VORowImpl row = (VORowImpl)vo.last();
    vo.setCurrentRow(row);
    vo.next();
    VORowImpl newrow = (VORowImpl)vo.createRow();
    vo.insertRow(newrow);
    

    I hope that helps!

    Thank you
    AJ

Maybe you are looking for

  • Gross F55 / Speedgrade

    Hello I'm working on a project in Speedgrade with the material of a F55. What would be the best workflow? The raw material is not recognized by Speedgrade. My guess is: -Editor edits with SxS footage. -Converting raw in Raw Viewer -Export to DPX usin

  • Problems of synchronization/Notification on network WiFi home

    I asked over on reddit without any successful response. In fact, when I'm on my own home Wifi network, I have a lot of apps that simply do not synchronize. This includes gmail, fitbit, Foxnews, Snapchat, WhatsApp and various games. Some applications

  • the value position of file problem

    Hi all The question that I get is as follows: I want to add to an already existing data other .txt file. To do this, I use "leader Set position" function to determine the current file mark. This function accepts as input, ONLY a refnum! but in my cas

  • Updates are not installed

    Whenever I have shut down my computer, there is the same 6 updates waiting to be downloaded and installed. These are some KB979909 KB982168 KB2656352 KB2572073 KB2633880 KB2518864 Are obviously not needed, so how can I stop this repetitive download,

  • Stop junk emails

    original title: the unwanted e-mails How do you get companies to stop sending me unwanted emails if the do not have a link to unsubscribe.