generate duplicates using more than one condition

Dear experts, I have the sample data below
create table tbl_one
(
  p_id number(30),
  c_id number(30),
  location_a varchar2(300),
  flag varchar2(1)
);

insert into tbl_one
  (p_id, c_id, location_a, flag)
values
  (1, 112, 'ref_1', '1');

insert into tbl_one
  (p_id, c_id, location_a, flag)
values
  (1, 113, 'ref_1', '1');
  
insert into tbl_one
  (p_id, c_id, location_a, flag)
values
  (1, 114, 'ref_2', '1');
  
  
insert into tbl_one
  (p_id, c_id, location_a, flag)
values
  (2, 115, 'ref_3', '1');
  
insert into tbl_one
  (p_id, c_id, location_a, flag)
values
  (2, 116, 'ref_3', '1');
insert into tbl_one
  (p_id, c_id, location_a, flag)
values
  (2, 117, 'ref_4', '1');
This is the output I want below
PID    C_ID    LOCATION_A     FLAG
1        112     ref_1                 1
1        113     ref_1                 1
2        115     ref_3                 1
2        116     ref_3                 1
Basically, the output is obtained in all cases where the flag and the location_A is duplicated in the same nest

I need help with the query. Any help is appreciated. Thank you

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
select p_id, c_id, location_a, flag from
(
select p_id, c_id, location_a, flag, count('Dracula') over (partition by p_id, location_a, flag) cnt
from tbl_one
)
where cnt > 1
order by p_id, c_id
P_ID     C_ID     LOCATION_A     FLAG
1     112     ref_1     1
1     113     ref_1     1
2     115     ref_3     1
2     116     ref_3     1

Tags: Database

Similar Questions

  • How to use more than one condition set?

    Dear Sir

    I want to define more than one type of condition and use it together for all objects on the page, for example, page element, button page and etc.

    Is it possible to manage in "PL/SQL tends" to condition type? ("for example = >"Request = Expression'and'current page! = 1 Expression',..) If no response, is please tell me otherwise.

    Kind regards

    Saeed.

    Hi Saeed,

    Saeed reports says:

    I would like to know the conditions CGI and browsers. Can I view the document or essay on the condition type in pl/sql?

    Yes, you can also view the conditions of CGI Environment Variables and browser in "PL/SQL Expression.

    For example:

    • "The condition type" cgi_env SERVER_NAME = Expression 1 "can be transformed into" PL/SQL Expression"as:
    OWA_UTIL.GET_CGI_ENV('SERVER_NAME') = 'MyServer'
    
    • The condition type for browser condtions can be can be transformed into "PL/SQL Expression" as:
    instr(upper(OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT')),upper('Firefox/37.0')) > 0
    

    The following is old, but complete documentation on the Types of conditions:

    https://docs.Oracle.com/CD/E14373_01/AppDev.32/e11838/condition.htm#HTMDB25942

    I hope this helps!

    Kind regards

    Kiran

  • Can I use more than one flash drive to ready boost on Satellite L650/0ed

    Hello

    I have a toshiba Satellite L650/0ed, it's good if I use more than one drive 8 GB flash for "ready boost" - what is the maximum number of using flash-drives can devote to the "ready-boost.

    In addition, if I use a 16 gb flash drive, will this affect more memory "ready boost".

    Why the 3.5 drive seagate expansion 1 TB is not compatible for ready-boost.

    Thank you
    -Brent907

    Hi mate

    Please check this Microsoft page that describes the ReadyBosst
    http://Windows.Microsoft.com/en-us/Windows7/products/features/ReadyBoost

    There, you can find this statement:
    + ReadyBoost works with storage devices more flash. In Windows 7, it can handle more memory and even multiple devices * eight *, for a maximum of 256 GB of additional memory. +

    I hope this can be useful!

  • How do I avoid the accumulation of color / opacity where two brush strokes overlap?  In other words, I want to use more than one path with the Paintbrush tool, but see no additive effect where strokes overlap.  What Miss me?

    How do I avoid the accumulation of color / opacity where two brush strokes overlap?  In other words, I want to use more than one path with the Paintbrush tool, but see no additive effect where strokes overlap. 5 Lightroom

    I use it all the time. Turn your opacity, density and traffic all 100%.

    Benjamin

  • How to use more than one address at the same time?

    The Adobe server page that allows entry of a recipients address should not inform users how to add another address?  We separate them by semicolons? Commas?  Or is it still possible to use more than one address?

    Hi orison123,

    You talk about Adobe send? If Yes, you are absolutely right. Who should be written somewhere I had to double check and was able to send to multiple email addresses separated by commas or semicolons.

    Best,

    Sara

  • Can I use more than one html5/js animation produced with Flash/createjs in a Web site?

    Hi, I produce animations with Flash which will be delivered in createjs html5/js hollow. The problem is that after including the first animation in my html Web site, the rest of the animations are crushed with the first, that is why, if I attempt to insert a second animation in my site, in fact, it will replace the first animation, I had already placed...

    I already tried the following:

    -change the default canvasID to another

    -Change the resources and namespaces Javascript in Createjs export settings

    -manually change the name of the functions (lib, img, syc) in the Javacript file

    None of them seem to solve the problem. So I'm now wondering if it is actually possible to insert more than one animation in a Web site...

    I would appreciate a quick response because I am working on a project with a very tight schedule and really need to address this question right.

    Thank you very much in advance for the help.

    Then, you have made a mistake.

    Start with the two different FLAS.  one with a red rectangle on the stage and the other with a blue onstage rectangle and nothing else.  publish your html and js files.

    combine the two into one and, if you have a problem, the postcode of your a single html file and two js files.

  • How to use more than one page to design a report of similar form?

    Hello
    I'm designing a report of similar shape. and expand the extensible framework to contain the entire page or window like this page:
    Image:! http://up1.m5zn.com/photo/2008/12/21/07/e728mos12.jpg/jpg!

    Now, there is no space in the window to complete the design of the report.
    How the extensible framework to contain more than one page or a single window to complete the design of the report?

    Replace the panels vertical by Page 2 (or more if necessary) for the main page layout model.

  • If you use more than one Extension Native on Flash develop

    Hi, I got two DONKEY, one for and an AdMob and a Vibration (the example of Adobe) if I have both, activate one of them stops working (Vibration) if they are tested separately work correctly. The debugger does not match in native code. I tried to add the SWC in several ways: (including external selling library and library) but I can not make applications run more than a DONKEY... What can I do?

    Hello:

    Which is the platform you are targeted?

    the name of the methods of the initializer and finalizer (mentioned in extension.xml) ENA must be different for all native extensions that an application uses.

    You can check the values by extracting extension.xml of. DONKEY (you can rename it to .zip and unzip)

    Library must always be external (mention the CFC as external library)

  • Can I use more than one USB-6008 in the same program?

    I'm working on a project that may require up to six modules USB-6008.  Before I buy more I need to know if I can use all six at once in the same Lab View program.  Can anyone help?

    Hello Nick,

    LabVIEW is capable of handel that the number of data acquisition tasks quite easily, but you have to remember that USB has a maximum bandwidth. Therefore, you have to make sure you have enough on your PC USB hubs. In general there are between two to four USB slots by hub and each of them will have a maximum flow rate which will be divided between all devices connected to this hub. So even if you can get four USB DAQ devices attached to four USB ports if they are on the same hub, you might notice significantly reduced rates of data transfer. I would say rather than buying six or more USB 6008, why not buy a PCI card that is able to handel a lot more entries with greater bandwidth.

  • In Windows 7 Professional, Firefox has suddenly started using more than one symbol in the taskbar... Why?

    After you install Firefox it placed a symbol in the toolbar to launch. When you move the mouse over this symbol it would display then also the tabs that were open in the browser. Then, the program was launched and operating within this Firefox ONE symbol on the task bar... it was never (to a point), more of a symbol.

    Now suddenly he started to open a second Firefox symbol in the toolbar in which the browser really runs and displays the open tabs. In other words, I now have a Firefox symbol in the taskbar to launch the browser and the other, the second symbol in which the browser is running. I don't want because it takes too much space on the taskbar. How can I return to keep Firefox limited to a single symbol in the taskbar at all times?

    The first icon is "pinned" to the Windows 7 taskbar in an earlier version? Could you try unpinning and repinning Firefox and see if that helps?

    (I think someone has posted this same question yesterday, but I can't find the thread at the moment).

  • SUMIFS returns 0 if more than one condition entered

    Widgets

    Suzanne

    100

    Jon

    200

    Frank

    300

    Suzanne

    400

    Jon

    500

    Frank

    600

    Hello world

    I have problems with SUMIFS.  I want to know how many widgets Jon and Suzanne have set.  If I set SUMIFS(B:B,A:A,"Jon",A:A,"Suzanne"), I get zero.  Interestingly, if I just use a condition, like SUMIFS(B:B,A:A,"Jon"), I get 700 everything as I expect.  What I am doing wrong when I add this second condition?  I tried to put the formula in column C, so there is no chance of a circular reference, and I tried to put in a completely different table - the same results.

    I use numbers 3.6.1 on a MacBook Pro running El Capitan 10.11.3

    Thanks in advance for your help.

    Summits() does not work for you in this case.

    what you want is:

    SUMIF(A, "Suzanne", B) + SUMIF (A, B, "Jon")

    SUMIFS() requires the same condition for a particular line... it is necessary that Suzanne and Jon, be appointed in the same line, to include the value in the accumulation

  • Why Flash uses more than one gigabyte of RAM?

    He did this forever, and I just kept ignore him, cause I did not have enough.

    Now, it's boring.

    Simple example: load articles and videos from www.cracked.com, nothing major, just open say things of top 5 or 6 new ones that have been published in the last day or so.

    Flash going NUTS, ends up using on a gig of RAM and everything do stutter, videos buffer correctly, I can't yet scroll without jumping in front of half a page, instead of a few lines.

    One way around this, is of two clo0se the browser and re-open it, which is annoying to say the least. Or, to open the Task Manager and end the process there. Of course causing everything from videos to the crash of the ads, and I need to reload the page in any case.

    So, uh, why? and how he stop? There is no reason to Flash must be not only to help, but cling to a gig of RAM... it does not take much to load a stupid video.

    He started doing this at the time of Flash Player 10 is out, I think, and I use Firefox.

    Actually I have no idea why this program is running at all; It does not work on my machine.

    Flash Player on my system runs in the process of plugin - container.exe.

    Since you have a 64 bit system, can you try to run a 64-bit as Pale Moon or Waterfox browser?

  • can I use more than one processor in Cluster HA

    Hi, I have a cluster HA 3 node with 3 servers esx 3.0.1 running. I have a new 4th server which is esx 3.5 and I want to use as a member of the existing HA cluster. I was told that I can use a 3.5 server in a HA cluster that uses esx 3.0.1

    I added the 4th node successfully to the HA by using Virtual Center Server cluster. When I try to vmotion an existing to the new node virtual computer, I get an error message relating to the processor type. The error message indicates that:

    "host processor type is incompatible with the requirements of the virtual machines to the CPUID level."

    How will I know if the new 4th node has a type of processor that should work in a HA environment with my 3 existing nodes?

    I was told that I could run an esx 3.5 in a 3.0.1 cluster HA (I'll upgrade all three 3.0.1 nodes in January).

    We said that the processors could be dofferent in a HA cluster but must be of the same type. The processors in the server are:

    PowerEdge 2950 intel xeon e5335 2.00 ghz (esx 3.01)

    PowerEdge r710 intel xeon e5504 2.00 ghz (esx 3.5)

    I want to confirm that these servers must work together using vMotion in a HA cluster?

    Thank you, Mark

    Hello

    You can create an EVC Cluster.

    Attached a screen with CPU compatibility.

    Also read this one

    http://KB.VMware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1005764&sliceId=1&docTypeID=DT_KB_1_1&dialogID=53716504&StateID=0 0 54434575

    and this one

    http://KB.VMware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1003212&sliceId=1&docTypeID=DT_KB_1_1&dialogID=53716504&StateID=0 0 54434575

    MCP, VCP

  • InstanceSumIf w / more than one condition

    Hi all

    I would like to take the sum of the instances based on several conditions.

    With the help of the functional reference:
     InstanceSumIf(<relationship>, <number-attr>, <condition>) 
    Works well with the only condition and does not compile when you try to join two or more conditions with and/or

    in our example, the following works:
     Sum exam results = (a exam, student mark, the child has attended the exam) 
    While there are compilation issues
    Sum exam results = (a exam, student mark, the child has attended the exam and the child was not late for the exam) 
    where;
    the child was involved in the review and
    the child isn't late for the exam
    are 2 attributes.

    Hope that makes sense
    Thank you

    If you have configured an entity "child" so what you have here should do the trick. If there are 4 child entity instances should be 4 instances of "results of the child should be considered.

    If this isn't the case, then I would check to make sure that everything is being built the way you expect. Try looking through the (view... generation model Build - Model) to make sure your attributes of 'child' three fall under the entity "the child."

    If the attributes of your 'child' under the 'global' entity, something is wrong.

    How do you test your rules? What makes you think they work badly?

  • more than one condition of joining 2 tables of obiee

    Hello

    I use obiee 11g.

    There are 2 tables tableA and tableB where the join condition is (tableA.col1 = tableB.col1) or (tableA.col1 is null and tableB.col1 is null)
    where can I do this type of join.
    I tried to put in the physical layer-> f (x), but in error as only columns CIHI a d opertaors are allowed.

    Thank you

    Hello

    Maybe you should go for case function.
    As it indicates that your condition.

    Kind regards
    Lacouture.

Maybe you are looking for