queries mergeing two in single query? Thank you!!!

Hello gurus,

How to merge below two queries in a single request. All the I'm trying to do is get the acc_office_id and the pay_office_id... We want it in two different columns because the office for access and compensation IDs are in the same column. .so I m try to divide it into two columns.

Any help is greatly appreciated... Thank you very much!!!



-request for VAC office_id

Select acc.cust_id cust_id,
RO.office_id acc_office_id,
ACC.office_cd office_cd,
ACC.type_cd type_cd
of refoff ro,.
(select distinct f.cust_id cust_id,
f.type_cd type_cd,
f.office_cd office_cd
cutomer p,
Office f
where p.cust_id = f.cust_id
and f.type_cd in ('ACCT')) VAC
where acc.office_cd = ro.office_cd;


-request for pay office_id


Select bill.cust_id cust_id,
RO.office_id acc_office_id,
Bill.office_cd office_cd,
Bill.type_cd type_cd
of refoff ro,.
(select distinct f.cust_id cust_id,
f.type_cd type_cd,
f.office_cd office_cd
cutomer p,
Office f
where p.cust_id = f.cust_id
and f.type_cd in ("wages")) pay
where pay.office_cd = ro.office_cd;

Hello

SELECT       c.cust_id
,       MAX (CASE WHEN c.type_cd = 'part1' THEN o.office_cd END)     AS par1_offc_id
,       MAX (CASE WHEN c.type_cd = 'part2' THEN o.office_cd END)     AS par2_offc_id
,       MAX (CASE WHEN c.type_cd = 'part3' THEN o.office_cd END)     AS par3_offc_id
FROM       cust_office     c
JOIN       office     o     ON     c.office_cd     = o.office_id
GROUP BY  c.cust_id
;

The output I get from your sample data is a little different from what you have posted:

CUST_ID    PAR1_OFFC_ID    PAR2_OFFC_ID    PAR3_OFFC_ID
---------- --------------- --------------- ---------------
2001       10              10              10
2003       12              14
2002       11              11              12
2004       13              13              15

If the differences are not due to errors in your message, explain how you get correct results.

Tags: Database

Similar Questions

  • __When I am listening to music on the web page and scroll to the bottom of a page, the sound becomes stuttery and slows down rough down__and. This problem started two months ago. Thank you

    In addition, I noticed I have a problem with Flight Simulator Microsoft X too. I've never had a problem before. The sound is noisy, distorted and crackling. I do not add or remove anything in the last two months. It's really interesting that I have 7 games more like: IL2, star Wars and etc on my computer but there are no problem at all.

    Hello

    How can I stop my music skip or break down when I play?
    http://windowshelp.Microsoft.com/Windows/en-us/help/36db5c82-9247-4346-909a-f87743b653ae1033.mspx#EFC

    1. right click the icon of speaker near right lower clock - peripheral of reading

    Highlight speakers - properties (right same low page) - tab improvements - check Disable all sound effects
    Apply - OK

    2. check the configuration - Device Manager - sound, video and game controller

    Note name and complete model of the audio device - full decription - now double click it.
    Driver tab - notice the driver version. Then click on set to update driver (maybe nothing like MS is far
    behind the pilots of certification). Then right CLICK on the device - UNINSTALL - REBOOT - it will refresh
    the driver stack.

    Now go to system Maker and look for the updated drivers (or get the same if no new) it will be
    your rescue. Download - SAVE - go to where you put it-RIGHT click in it - RUN AS ADMIN

    Then do the same for the manufacturer of the device (like Realtek or who made the device).

    NOTE: Often restore audio drivers to check the version after installing and restarting is
    see if the version you have installed is there, otherwise repeat the installation - restart until it is. This may take
    several tests according to the recommitments how much he makes.

    Look at the sites of the manufacturer for drivers - and the manufacturer of the device manually.
    http://pcsupport.about.com/od/driverssupport/HT/driverdlmfgr.htm

    How to install a device driver in Vista Device Manager
    http://www.Vistax64.com/tutorials/193584-Device-Manager-install-driver.html

    I hope this helps.

    Rob - bicycle - Mark Twain said it is good.

  • How to understand the implementation of the plan in oracle I mean if I see two implementation plans for a single sql_id plans 2 How to determine the best execution plan? Links and answers are much appreciated. Thank you

    How to understand the implementation of the plan in oracle I mean if I see two implementation plans for a single sql_id plans 2 How to determine the best execution plan? Links and answers are much appreciated. Thank you

    How to understand the implementation of the plan in oracle I mean if I see two implementation plans for a single sql_id plans 2 How to determine the best execution plan? Links and answers are much appreciated. Thank you

    After two execution plans that have the same sql_id, so we can see what you're talking about.

    See "Oracle Explain Explain Plan optimizer" by Maria Colgan of the Oracle optimizer group

    http://www.Oracle.com/technetwork/database/bi-Datawarehousing/TWP-explain-the-explain-plan-052011-393674.PDF

    Examine the various aspects of a selectivity to parallel execution plan

    performance and understand what information you should be brilliant

    the plan can be overwhelming even for the most experienced DBA. This document

    offers a detailed explanation on each of the aspects of the execution plan and a

    Overview of what caused the CBO to make the decision, he did.

  • TWO OS on a single machine virtual is possible or po?  (OS on a virtual machine of towing isn't possible tro?)  and thank you

    TWO OS on a single machine virtual is possible or po?  (OS on a virtual machine of towing isn't possible tro?)  and thank you

    Voila now I need to create a machine with a characteristic (two processor two NIC etc...) and the more important the two system c which will be disappointed the win XP and Win server 2003 I have a big prob to find how to do this (this is my problem)

  • Merge two tables or queries, not identical

    This is probably the dumbest question I posted again, but my mind is numb and I don't get anywhere, no matter how I google conditions.

    I have three tables in a MS Access database: owners, other vehicles. Owners is owner info, vehicles is car info, other info on various items. Vehicles and others have an OwnerID field which, funny, corresponds to the ID field in owners. What I'm trying to do is to shoot all the vehicles and all the other elements which belong to a single owner and have been added by a certain date. I'm obviously going to this topic back, because after two days ago to look at, I now have a working query syntactically who returns 739 records when he must return to 6. I think that this is a new personal record.

    I guess the first question is if I should run two separate queries (one for vehicles, one for the other) and merge them nicely with the CF code or pull all at once with a big request. No idea, so far, has worked. Hope, because the result is a report in the following format:

    Name of the owner
    Info vehicle here, sorted by date added
    Info vehicle here, sorted by date added
    Other info here, sorted by date added
    Other info here, sorted by date added
    -----------------------------------------------------------
    4 records

    Name of the owner
    Info vehicle here, sorted by date added
    etc etc.
    ------------------------------------------------------------
    # disks, etc.

    I failed a loop in separate queries, so here's the current Select statement.

    SELECT owners.ownerid, owners.fname, owners.lname, owners.bname,
    Vehicles.ID as vid, vehicles.ownerid as vownerid,
    Vehicles.Year as vyear, vehicles.mfr as vmfr, vehicles.model as vmodel,
    Vehicles.Price as vprice, vehicles.date_add as vdate_add,
    Other.ID as iid, other.ownerid as iownerid,
    Other.Year as iyear, other.mfr as imfr,
    Other.Model as imodel, other.item_name as iname
    Other.Price as iprice, other.date_add as idate_add
    Owners, vehicles, other
    WHERE (vehicles.ownerID = owners.ownerID
    AND vehicles.date_add < #createODBCDate (variables.begin_date) #)
    OR (other.ownerID = owners.ownerID
    AND other.date_add < #createODBCDate (variables.begin_date) #)
    ORDER BY vehicles.ownerID, vehicles. Date_add, other.ownerID, other.date_add

    Anyone has any idea where I should start? I know it shouldn't be this difficult.
    Thank you.

    Take another look at the posted solution by draves, try to remove other from OF in the first query, and vehicles FROM in the second, since nothing is selected where linked to, these tables in their respective applications. (I think it was probably just an oversight)

    Select x.*)
    SELECT "1" as skey, 'VEHICLE' as sname,
    Owners.ownerID, owners.fname, owners.lname, owners.bname,
    Vehicles.ID, vehicles.ownerid, vehicles.year, vehicles.mfr, vehicles.model,
    "like item_name, vehicles.price, vehicles.date_add
    Owners, vehicles
    WHERE vehicles.ownerID = owners.ownerID
    AND vehicles.date_add<>
    Union of all the
    SELECT "2" as skey, "The OTHER" as sname.
    Owners.ownerID, owners.fname, owners.lname, owners.bname,
    Other.ID, other.ownerid, other.year, other.mfr, other.model,
    Other.item_name, other. Price, other.date_add
    Owners, other
    WHERE other.ownerID = owners.ownerID
    AND other.date_add<>
    ) x
    ORDER BY lname, fname, ownerID skey, Date_add

    Phil

  • MERGE TWO QUERIES...

    Hi all

    I have two queries like this...

    I want to have a single query of the two tables satisfying condition where that show all RELATIONSHIP, FILED_NAME, P2. ATTRIBUTE, P3. ATTRIBUTE, DESCRIPTION of the AREA, the two SOURCE tables P3 AND P2.

    Appreciate your help.

    Thank you/kumar

    Published by: kumar73 on May 28, 2010 09:49

    Hope you have understood my requirement.

    Ah, I see now that I misread your question (it must be a 'weekend-thing' ;)).

    Try something like this:

    select p3.relation
    ,      p3.field_name
    ,      p2.attribute
    ,      p3.attribute
    ,      p3.value_description
    ,      p3.source
    from ( select relation, field_name, attribute, field_description, source
           from p3i2009q2_variable_info p3
          where relation not in
                ('CHAI', 'ITAB', 'ITB2', 'ITB3', 'MINI', 'NOTE', 'MINC', 'FINI',
                 'FTIM', 'FWTG', 'FMLY', 'FMIS', 'FSUM', 'MEMB', 'FINC', 'FASO')
            and (substr(field_name, -2) in
                ('X1', 'X2', 'X3', 'X4', 'X5', 'X0', 'XA', 'XB', 'XM', 'XP', 'CM', 'MT') or
                substr(field_name, -1) in ('X') or substr(field_name, 1) in ('J'))
            and (attribute like 'NUM%' or attribute = '-')
         ) p3
    ,    ( select relation, field_name, attribute, field_description, source
           from p2i2009m04_variable_info p2
          where relation not in
                ('CHAI', 'ITAB', 'ITB2', 'ITB3', 'MINI', 'NOTE', 'MINC', 'FINI',
                 'FTIM', 'FWTG', 'FMLY', 'FMIS', 'FSUM', 'MEMB', 'FINC', 'FASO')
            and (substr(field_name, -2) in
                ('X1', 'X2', 'X3', 'X4', 'X5', 'X0', 'XA', 'XB', 'XM', 'XP', 'CM', 'MT') or
                substr(field_name, -1) in ('X') or substr(field_name, 1) in ('J'))
            and (attribute like 'NUM%' or attribute = '-')
         ) p2
    where p3.relation = p2.relation
    order by relation;
    

    You may need to adjust my untested example, for example you might need an outer join and/or add predicates more as you wish.

  • How can I use a panel of single query with criteria of two view?

    Hi all

    I have a requirement to allow users to change the "display mode" on a table of tree search results for an advanced search page. What this will do, is change the structure of how the data are arranged. In one case, the picture of the tree is 3 levels deep, otherwise, it's only 2 with different data at the level of the root node.


    What I've done so far:


    1) I exposed the relationship of data for these two ways to view the data in the data model of the module of the application.

    (2) I created a view of criteria in two view objects that are originally relationships, where (for simplicity) I'm comparing only one field.

    It is in the object from a point of view:

    <ViewCriteria
        Name="PartsVOCriteria"
        ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartsVO"
        Conjunction="AND">
        <Properties>... </Properties>
        <ViewCriteriaRow
          Name="vcrow23"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="PartDiscrepantItemsWithIRVO"
            ViewAttribute="PartDiscrepantItemsWithIRVO"
            Operator="EXISTS"
            Conjunction="AND"
            IsNestedCriteria="true"
            Required="Optional">
            <ViewCriteria
              Name="PartDiscrepantItemsWithIRVONestedCriteria"
              ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartDiscrepantItemsWithIRVO"
              Conjunction="AND">
              <ViewCriteriaRow
                Name="vcrow26"
                UpperColumns="1">
                <ViewCriteriaItem
                  Name="InspectionRecordNumber"
                  ViewAttribute="InspectionRecordNumber"
                  Operator="="
                  Conjunction="AND"
                  Value=""
                  Required="Optional"/>
              </ViewCriteriaRow>
            </ViewCriteria>
          </ViewCriteriaItem>
        </ViewCriteriaRow>
      </ViewCriteria>
    

    and it is in the other display object:

     <ViewCriteria
          Name="IRSearchCriteria"
          ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.InspectionRecordVO"
          Conjunction="AND">
          <Properties>... </Properties>
          <ViewCriteriaRow
             Name="vcrow7"
             UpperColumns="1">
             <ViewCriteriaItem
                Name="InspectionRecordNumber"
                ViewAttribute="InspectionRecordNumber"
                Operator="="
                Conjunction="AND"
                Required="Optional"/>
          </ViewCriteriaRow>
       </ViewCriteria>
    

    (3) I had a query Panel table and automatically generated tree by doing drag control data for ONE of the relationship of view object data that is exposed in the app module. Then, I created a second query Panel table and tree in the same way but using the data control to the other. I am one of the query cache permanently panels and toggling the visibility of the tree based on the user tables selects display mode. Both have separate links and iterators.

    It is a part of the definition of the page:

    <executables>
        <variableIterator id="variables"/>
        <searchRegion Criteria="IRSearchCriteria"
                      Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="InspectionRecordVOIterator"
                      id="IRSearchCriteriaQuery"/>
        <iterator Binds="InspectionRecordVO" RangeSize="25"
                  DataControl="QARS_AppModuleDataControl"
                  id="InspectionRecordVOIterator" ChangeEventPolicy="ppr"/>
        <iterator Binds="Root.QARS_AppModule.PartsVO1"
                  DataControl="QarsMasterAppModuleDataControl" RangeSize="25"
                  id="PartsVO1Iterator"/>
        <searchRegion Criteria="PartsVOCriteria"
                      Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="PartsVO1Iterator" id="PartsVOCriteriaQuery"/>
      </executables>
    

    (4) I have created a queryListener custom to delegate the query event.

    It's in my jsp to advanced search page:

    <af:query id="qryId1" headerText="Search" disclosed="true"
                      value="#{bindings.IRSearchCriteriaQuery.queryDescriptor}"
                      model="#{bindings.IRSearchCriteriaQuery.queryModel}"
                      queryListener="#{pageFlowScope.SearchBean.doSearch}"
                      queryOperationListener="#{bindings.IRSearchCriteriaQuery.processQueryOperation}"
                      resultComponentId="::resId2" maxColumns="1"
                      displayMode="compact" type="stretch"/>
    

    It's in my grain of support:

    public void doSearch(QueryEvent queryEvent) {
          String bindingName = flag
             ? "#{bindings.IRSearchCriteriaQuery.processQuery}"
             : "#{bindings.PartsVOCriteriaQuery.processQuery}";
    
          invokeMethodExpression(bindingName, queryEvent);
       }
    
       private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
          FacesContext fctx = FacesContext.getCurrentInstance();
          ELContext elContext = fctx.getELContext();
          ExpressionFactory eFactory = fctx.getApplication().getExpressionFactory();
         
          MethodExpression mexpr =
             eFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
         
          mexpr.invoke(elContext, new Object[] { queryEvent });
       }
    

    When no number inspection (the only field of research so far) is provided in the query Panel, then it behaves properly. Namely, table tree shows all the search results. However, when a record number of inspection is supplied the table from the tree that was created with the query running Board (don't forget there are two query panels, one of them hides) shows a single result (this is correct), while the other table tree (the one with the control panel hidden query that is not used) shows all the results (this is NOT correct).

    What I'm trying to accomplish is still doable? If so, what Miss me?

    I use JDeveloper 11.1.1.7

    Thank you

    Bill

    I ended up keeping a single query visible panel permanently and the other hidden permanently. When you perform a search using the table that has the hidden query Panel, I have the descriptor of the request for the Panel to request hidden using the descriptor of the request of the Commission in visible motion of the seeds and then delegate the request:

       public void doSearch(QueryEvent queryEvent) {
          String bindingName = null;
    
          if(isIrTableRendered()) {
             bindingName = "#{bindings.IRSearchCriteriaQuery.processQuery}";
          } else {
             seedPartsQueryDescriptor();
             bindingName = "#{bindings.PartsVOCriteriaQuery.processQuery}";
             queryEvent = new QueryEvent(partsQuery, partsQuery.getValue());
          }
    
          invokeMethodExpression(bindingName, queryEvent);
       }
    
       private void seedPartsQueryDescriptor() {
          ConjunctionCriterion criterion = irQuery.getValue().getConjunctionCriterion();  
    
          for(Criterion criteria : criterion.getCriterionList()) {
             AttributeCriterion attributeCriteria = (AttributeCriterion)criteria;
    
             List values = attributeCriteria.getValues();
    
             String qualifiedName = attributeCriteria.getAttribute().getName();
             int indexOfDot = qualifiedName.lastIndexOf(".");
    
             String name = indexOfDot < 0
                ? qualifiedName
                : qualifiedName.substring(indexOfDot + 1);
    
             ConjunctionCriterion partsCriterion =
                partsQuery.getValue().getConjunctionCriterion();
    
             for (Criterion partsCriteria : partsCriterion.getCriterionList()) {
                AttributeCriterion partsAttributeCriteria =
                   (AttributeCriterion) partsCriteria;
    
                String partsQualifiedName =
                   partsAttributeCriteria.getAttribute().getName();
    
                if (partsQualifiedName.endsWith(name)) {
                   partsAttributeCriteria.setOperator(attributeCriteria.getOperator());
    
                   List partsValues = partsAttributeCriteria.getValues();
    
                   partsValues.clear();
    
                   for (int i = 0, count = values.size(); i < count; i++) {
                      partsValues.set(i, values.get(i));
                   }
                }
             }
          }
       }
    
       private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          ELContext elContext = facesContext.getELContext();
          ExpressionFactory expressionFactory =
             facesContext.getApplication().getExpressionFactory();
    
          MethodExpression methodExpression =
             expressionFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
    
          methodExpression.invoke(elContext, new Object[] { queryEvent });
       }
    

    Then when the basis advanced/Panel visible query button, I put the same mode for the control panel hidden query programmatically:

       public void handleQueryModeChange(QueryOperationEvent queryOperationEvent) {
          if(queryOperationEvent.getOperation() == QueryOperationEvent.Operation.MODE_CHANGE) {
             QueryMode queryMode = (QueryMode) irQuery.getValue().getUIHints().get(QueryDescriptor.UIHINT_MODE);
             QueryDescriptor queryDescriptor = partsQuery.getValue();
    
             queryDescriptor.changeMode(queryMode);
             AdfFacesContext.getCurrentInstance().addPartialTarget(partsQuery);
          }
       }
    
  • How to merge 2 albums of photos software? Thank you.

    Hello

    With the software how to merge 2 pictures? Thank you.

    Google translation

    How to merge 2 albums of photos software? Thank you.

    Hello

    With the software Photo how to merge two albums? Thank you.

    In the Photo Albums are logically the organizational elements - to merge the 2 albums of Photos you open one, just select and then drag photos to the album of target - then delete them from the source album

    If you call your photo library an album there is no way to merge libraries - you can merge pictures is of two libraries and most of their metadata by downloading each to iCloud photo library or by using PowerPhotos

    LN

  • Hello; I just bought the annual cc for students; After installing it on my workstation, I tried to do the same thing on my surface, but it seems that I can't. Anyone know if the version of the student cannot be installed on a single pc? Thank you

    Hello; I just bought the annual cc for students; After installing it on my workstation, I tried to do the same thing on my surface, but it seems that I can't. Anyone know if the version of the student cannot be installed on a single pc? Thank you

    Hello

    You can have the creative cloud installed and signed in on two computers as long as you don't use it on one at a time. Download and install as you did on the first computer, sign in to your Adobe account on the Adobe using your Adobe ID website, download the desktop app from clouds, then download the software. Sign on a computer that should not be used: log in and log out of the desktop Adobe Creative Cloud application

    Also creative cloud cannot be installed on a Surface of 3 pro:-Cloud Creative and Microsoft Surface Pro 3 | Creative blog Cloud by Adobe

  • How to merge two catalogs into a single master catalogue in LR CC 2015?

    Here are screenshots after I merged the two catalogues on two different external hard drives.  Now, they are on the same external hard drive, but they seem to be two separate catalogues.  What should I do to complete the task?  Thank you!  Diane

    Screen Shot 2015-06-30 at 09.20.38.png

    Screen Shot 2015-06-30 at 09.20.52.png

    PS looking at your screenshots the best screenshots seem to show a folder hierarchy. This isn't a catalog but simply the folder with your originals in it structure. The second screenshot appears to show three different catalogues files and another folder, probably with pictures inside.

  • Merge two column in single column value

    Team,

    I have a requirement where in I need to merge 2 column values in a single column.

    e.g. I Percent_complete column in my table. and my table has only one record.

    I need to ask questions that I need to store the values of percent_complete and (100-percent_complete) in a single column.

    ex

    Percentage complete is set to 30.

    I need to select the 30 and 70 (100-30) both in a single column.

    Thank you

    If you mean like this?

    SQL > ed
    A written file afiedt.buf

    1 with t (select 30 as double percent_complete)
    2  --
    3 end of test data
    4  --
    5. Select decode(rownum,1,percent_complete,100-percent_complete) as percent_complete
    6 t
    7 * connect by rownum<=>
    SQL > /.

    PERCENT_COMPLETE
    ----------------
    30
    70

  • Can you check data in a table or another, but not both in a single query?

    I have a situation where I need to connect the two tables, but the data can be in another table (archive) or different records are in both but I want the last disk in two tables:

    ACCOUNT

    AccountID name

    John Doe 123

    Jane 124 Donaldson

    125 Harold Douglas

    MARKETER_ACCOUNT

    AccountID key Marketer StartDate EndDate

    1001 123 10526 8/3/2008 9/27/2009

    1017 123 10987 9/28 / 2009 12/31/4712 (high date ~ that means currently with this Distributor)

    1023 124 10541 03/12/2010 12/31/4712

    ARCHIVES

    AccountID key Marketer StartDate EndDate

    1015 124 10526 8/3/2008 12/02/2010

    1033 125 10987 01/01/2011 01/31/2012

    If my query should return the following:

    123 John Doe 10526 8/3/2008 9/27/2009

    Jane Donaldson 10541 12/03/2010 31/12/124 4712 (that is the later of the two folders for this account between tables Archives and marketer_account)

    125 Harold Douglas 10987 01/01/2011 01/31/2012 (it is in the archives, so get this recording)

    I'm not sure how to do this in a single query.  Beware, I am possibly reading several accounts at once and return to a .net collection

    Open CURSOR_ACCT

    Select the account ID

    Of

    ACCOUNT A,

    MARKETER_ACCOUNT M.

    R OF THE ARCHIVES

    where A.AccountID = nvl ((select max (M.EndDate) of Marketer_account M2

    where M2. AccountID is A.AccountID),

    (select max (R.EndDate) in Archive R2

    where R2. AccountID = A.AccountID)

    and upper (B.SID) as a parameter. '%'

    < can you do a NVL like that?   probably not...   I want to be able to get the MAX registration for this account on the table of MarketerACcount OR recording max for this account to off the table to Archive, but not the two >

    (setting could be 'DO', so I return all names beginning with...)

    Hello

    So, you have a few lines in marketer_account and the other rows in the archives, but you do not want to treat all lines, as if it were a table, is it?

    This sounds like a job for the UNION:

    WITH union_data AS

    (

    SELECT StartDate, EndDate, Marketer, AccountID

    OF marketer_account

    UNION ALL

    SELECT StartDate, EndDate, Marketer, AccountID

    To archive

    )

    got_MaxEndDate AS

    (

    SELECT StartDate, EndDate, Marketer, AccountID

    MAX (EndDate) ON (AccountID PARTITION) AS MaxEndDate

    Of union_data

    )

    SELECT a.AccountID, B.SID

    m.Marketer, m.StartDate, m.EndDate

    One ACCOUNT

    JOIN got_MaxEndDate m ON m.AccoutnID = a.AccoundID

    WHERE m.EndDate = m.MaxEndDate

    ;

    I hope that answers your question.
    If this is not the case, after a CREATE TABLE and INSERT statements for your sample data.
    Report when the above query is the production of incorrect results and explain, using specific examples, how to get results in these places.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

    .

    Starting with version 8, the maximum year in DATEs Oracle is 9999, not 4712.

  • Merge two accounts of VMware communities into a single

    Hello

    I would like to know how can I merge two accounts VMware communities, I have one. I use the first account to post in the communities and the second account where I have all my certifications, courses I've done and everything. I want to migrate everything from the first to the second (points, debates, etc.), well, in the account that I have all the trainings, courses, certifications, etc. have also all the things communities I in the first account.

    Thank you.

    Guido.

    Have a look by the window / http://communities.vmware.com/docs/DOC-12285

    You can email [email protected] and explain your situation. Make very clear about what you need to accomplish.

  • How to merge two lists thanks to a rational solution alphabetically?

    Having two lists of legends he both languages and need to merge in alphabetical order, but this solution is very poor.

    (list x)

    Imperial palace, Barcelona, 2012

    CEMENTERIO, 2009

    (list a)

    Imperial palace

    Cemetery

    to get:

    Imperial palace, Barcelona, 2012

    Imperial palace

    CEMENTERIO, 2009

    Cemetery

    A very naïve method:

    · List number

    · convert numbering to text

    · in the list there add a constant to sort in the order:

    1. Imperial Palace, Barcelona, 2012

    2 Cementerio, 2009

    Imperial palace of 1A.

    Cemetery of 2A.

    and sorting:

    1. Imperial Palace, Barcelona, 2012

    Imperial palace of 1A.

    2 Cementerio, 2009

    Cemetery of 2A.

    Remove the code:

    Imperial palace, Barcelona, 2012

    Imperial palace

    CEMENTERIO, 2009

    Cemetery

    (the italics are not required)

    Thank you.

    Without thinking much, here's an easy way:

    1st list: convert to table (Tab1) + add a second column to the right.

    2nd list: convert to table (Tab2).

    As I understand it, there are the same number of cells.

    Copy Tab2 instead of the second column of Tab1.

    Convert the resulting table (Tab1-2) in the text

    Search: tab, to be replaced by: \r

  • Merge two query results

    Is it possible to merge 2 query results?

    I have a function that returns a querey result.

    < CFSET Temp = query1 >
    < CFSET FNCTransfers = temp >

    Now I want to change the query to return a query result merged

    < CFSET Temp = query1 >
    < CFSET temp2 = query2 >

    Is it possible to merge two results?

    Something like that (I know it cannot be like that)
    < CFSET FNCTransfers = temp1 & temp2 >

    Maby there should be a union and query of query?


    The UNION could be the way to go. the results of the query must match
    between 2 requests (the types must match for two field data queries)


    SELECT * FROM query1
    UNION
    SELECT * FROM query2

    Kruse says:
    > Is it possible to merge 2 query results?
    >
    > I have a function that returns a querey result.
    >
    >< cfset="" temp="query1">
    >
    >
    > Now I want to change the query to return a query result merged
    >
    >< cfset="" temp="query1">
    >
    >
    > Is it possible to merge two results?
    >
    > Something like that (I know it cannot be like that)
    >
    >
    > Maby there should be a union and query of query?
    >

Maybe you are looking for

  • Toshiba SpursEngine U.S. campaign

    If you agree with my statement on Facebook then explain why and say Toshiba to release where you live.

  • failure of black ink

    Our photosmart HP 5510 will not print black. It was working fine until we bought the new color and black cartridges. We have cleaned the filter and followed all the troubleshooting tips. It will still NOT black prinf. Help

  • Running Windows 7 64 bit to 32 bit

    I have windows 7 64 bit instaled, but his footstool to 32 bits can tell me what to do?

  • Satellite L20-199: System cannot identify WLAN card

    Hello I have a L20-199 with LAN wireless satellite. But the system cannot identify the (hardware) wireless network card. Trying to install Intell WLAN driver on the site of Toshiba relevent also impossible to locate a WLAN card. How to install or ide

  • Clear values on shutdown

    Hi I have a tab with a series of pages that proeeds in the order. For example when you press a button on page 1 it is on page 2 and so on. All these pages have many indicators in form of string, digital, dial, slide, etc. I want to erase all these va