Generating duplicates using more than one condition

dear experts I have the following 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 desire 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                 1basically the output is obtained for all cases where the location_A and flag are duplicated in the same pid
I need help with the query. All 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

Similar Messages

  • How to use more than one condition together?

    Dear,
    I want to set more than one condition type and use it together for any objects in page, for example page item,page button and etc.
    Is it possible to handle in "PL/SQL Experssion" at condition type?(e.g =>"Request= Expression" and "Current page!= Expression 1",..) if no is answer, please tell me other ways.
    Regards,
    Saeed.

    Hi Saeed,
    Saeed Hassanpour wrote:
    I'd like to know about CGI and Browsers conditions. Can I refer to document or essay about condition type in pl/sql?
        Yes, you can also refer CGI Environment Variables and Browser conditions in "PL/SQL Expression".
        For example :
    The condition type "When cgi_env SERVER_NAME = Expression 1" can be transformed to "PL/SQL Expression" as:
    OWA_UTIL.GET_CGI_ENV('SERVER_NAME') = 'MyServer'
    The condition type for Browser condtions can be can be transformed to "PL/SQL Expression" as:
    instr(upper(OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT')),upper('Firefox/37.0')) > 0
        Following is old but comprehensive documentation about Condition Types:
        https://docs.oracle.com/cd/E14373_01/appdev.32/e11838/condition.htm#HTMDB25942
        Hope this helps!
    Regards,
    Kiran

  • Multiple AirPort Express units - use more than one at a time?

    If I connect three Airport Express units in three different rooms, can I use more than one at a time?
    Can I choose to only use 2 out of the 3 at one time?
    Thanks.

    Yes. With iTunes 6.0.2 or later, you can send an AirTunes stream to multiple remote AirPort Express units, provided that each AirPort Express has the latest AirPort firmware. The maximum number of remote AirPort Express units is three to six in typical conditions. The number that works for you will depend on your environmental conditions (such as building composition and local radio interference), distance to the remote AirPort Express units, and available network capacity relative to your other usage.

  • How to use more than one dataset?

    Hi,
    Is there any way to use more than one dataset in one report?
    Thanks..

    Yes, we can use more than one dataset..
    We can group the data sets using group feature and or(|) condition, like below
    <?for-each-group:/DATA/TOTAL_DEP/TOTAL_DEP_ROW|/DATA/FA_DATA/FA_DATA_ROW?>

  • Value Set Use More Than One table

    folks, is there a way to use more than one table in the value set of type table?

    ok if i want to create a view and then when i'm trying to create a table value set. what application should i be selecting? i have created my view in apps schema. if i look in application object library then i do not see it in the list. So i need to register this view? and i think we could not register the views. We could only register tables in apps.Yes you can -- In the Value Sets form (Edit Information button), you can set the view name in the "Table Name" field, and write a (Where/Order by) condition in the same window.
    Oracle Applications Flexfields Guide -- R12
    http://download.oracle.com/docs/cd/B53825_03/current/acrobat/121flexug.pdf
    Oracle Applications Flexfields Guide -- 11i
    http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115flexug.pdf
    Thanks,
    Hussein

  • Can an assigned PO use more than one work order?

    Can an assigned PO use more than one work order?

    Hi,
    Please avoid duplicate posting in the forum. You already an active thread which is in progress. there is possibility that Moderators might lock your threads.
    Thanks,
    Sudhakar
    Message was edited by: Sudhakar Pappu
    Next time please mark for moderation so duplicates can be removed - thanks I have locked this thread
    Regards
    Virendra
    Message was edited by: Virendra Pal

  • How can I use more than one Data Provider in my web Apps

    I am trying to use two different data provider in my web apps to run two different queries from the same table ,the data provider A is working correctly but when I attempt to run data provider B ,It display an error page ,here is the error message : Exception Details :javax.servlet.ServletEx ception
    java.lang.RuntimeException: java.sql.SQLException : Cannot connect .Both dataSourceName and url properties are null.

    Hi,
    You can use more than one data provider in your application. However if you have defined a dataprovider for a particular table already, and wish to bind a component, select the component and use its context menu to Bind to Data...

  • Can I use more than one Apple ID on one device

    I have seen some answers to this type of question before but not that since the ios 6 so will ask again. My household shares an Apple ID and it has worked great as we have added devices and purchased apps.  My problem now is this, we have hit a point where I have work things on my iPad and iPhone that I really don't need to be shared with the whole family but it isn't a major deal or security risk. I don't want to give up the advantages of having the household ID.  Is there an easy way to have another ID on my iPad and switch between them without having major complications?  I am for the most part a techie so not afraid of these kind of things but I can't afford to lose everything right now and take the time to set it all back up so getting advice here.  Thanks in advance for any help you can give.

    You can use more than one apple id, but keep in mind that when apps need updating that you'll will need to sign in with correct credentials to update them.
    Share an apple id for the itunes and app stores, but keep your own for icloud, facetime and messages.
    Managing and Sharing multiple id's with your family
    http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/

  • Can we use more than one Help Provider class in a same project in ADF11g

    Hi All,
    There are two help providers i want to use .They are "ResourceBundleHelpProvider","OHW Help Provider"
    In adf-settings.xml file
    <help-provider>
    <help-provider-class>oracle.adf.view.rich.help.ResourceBundleHelpProvider</help-provider-class>
    <property>
    <property-name>baseName</property-name>
    <value>com.symmetry.dashboard.panels.Help</value>
    </property>
    </help-provider>
    if try to register both help providers confliction occurs. Is it possible to register and use more than one help provider.?
    Thanks in advance.:)

    Thanks Frank,
    In adf-settings.xml file
    <help-provider>
    <help-provider-class>oracle.adf.view.rich.help.ResourceBundleHelpProvider</help-provider-class>
    <property>
    <property-name>baseName</property-name>
    <value>com.symmetry.dashboard.panels.Help</value>
    </property>
    </help-provider>
    <help-provider prefix="RB_">
    <help-provider-class>oracle.help.web.rich.helpProvider.OHWHelpProvider</help-provider-class>
    <property>
    <property-name>ohwConfigFileURL</property-name>
    <value>/myHelpset/config.xml</value>
    </property>
    <property>
    <property-name>baseURI</property-name>
    <value>http://127.0.0.1:7101/Dashboard_workflow/myHelpset/%3c/value>
    </property>
    </help-provider>
    I differentiated the help providers with the "prefix" attribute in the <help-provider> tag. So now confliction is not occuring between those.
    I used this prefix in the "helpTopicId" property of the adf components like "input text box" . I got the result. :)

  • Can I use more than one song in a slideshow?

    Can I use more than one song in a slideshow?  If so, how?  Thank you

    Dear Barbara B. 
    Thank you for your response.  Good idea about combining the songs in another program first.
    Thank you for your time and thoughts.

  • Can I use more than one SIM card in my iPhone if I buy it SIM free?

    Can I use more than one SIM card in my iPhone if I buy it SIM free?

    Sim free is not enough, you can use different sim if it's unlock.

  • Can I use more than one Apple ID for an Apple TV?

    I wanted to use more than one Apple ID account on my Apple TV, is that possible?

    Welcome to the Apple Community.
    You can only use one ID for purchasing from the Apple TV, but you can stream content from multiple libraries even though they have different ID's

  • Can u use more than one apple account on your device and itunes

    Can u use more than one apple account on your device and itunes

    Yes, but you have to logout of one, and login to the other.
    If it is an iPhone/iPad/iPod Touch and you buy apps on different accounts, when it comes time to update an app, you have to specify the password for the account used to acquirer the app. You change an iOS account via Settings -> Store -> Apple ID (tap on it), and start by logging out and then you can enter the other Id
    So it is possible, but it can also be a pain.

  • Can I use more than one iTunes account with my apple TV?

    Can I use more than one iTunes account with my apple TV?

    That depends what you mean. If you mean can you purchase from more than one iTunes account on the Apple TV, then the answer is no. If you mean can you stream from more than one iTunes library, which use different accounts, then the answer is yes, so long as they both use the same ID and password for homesharing.

  • I keep my library on an external hard drive 4TB.  It's full.  Can I use more than one hard drive to keep my library on?

    I keep my iTunes library on an external hard drive 4TB.  It's full.  Can I use more than one hard drive to keep my library on? Like two 4TB next to each other.

    Create a concatenated disk set
    Increase storage space with a concatenated RAID set (also called “Just a Bunch of Disks” or JBOD). If you need one large disk, but you have only several smaller disks, you can create a concatenated disk set to use several small disks as one large disk.
    Open Disk Utility, in the Utilities folder in Launchpad.
    Select one of the disks that you want in the set, and then click RAID.
    Click Add (+), and type a name for the RAID set.
    Choose a format from the Format pop-up menu. Usually you’ll choose the Mac OS Extended (Journaled) format.
    Choose Concatenated Disk Set from the RAID Type pop-up menu.
    Drag the disks you want to add to the set to the list on the right.
    Click Create.
    Exerpt from:
    Disk Utility 12.x: Create a RAID set - Apple - Support
    Note that the biggest CON to concatenated RAID configurations is vulnerability to volume failure. If either disk fails, the whole volume fails. If you choose this option, I would highly recommend backing up your music to a cloud service. There are very cheap per GB/storage, and some of the most reputable actually offer unlimited storage:
    Five Best Cloud Storage Providers - Lifehacker

Maybe you are looking for

  • TDS TAX AMOUNT  IS NOT MACHING WITH INVOICE WTAX AMOUNTu2019

    Dear All, I am Facing Following Problem in TDS While creating an A/P Invoice after putting row level information when user click on u2018ADDu2019 button u201CWithholding Tax Tableu201D opens for deduction of TDS amount. When user selects u201CWithhol

  • Fpga data persistence volatility

    I was just wondering about the persistence/volatility of the various memory methods after cycling power to LabVIEW FPGA Devices?  Is it possible to ensure that data persists after cycling power? Jordan McBain, PhD LabVIEW Controls Engineer Revolution

  • Splitting Stereo Files

    How do you split stereo files in Logic? Anyone? Whenever I import a stereo file, it comes as one interleaved track. I change the track to accept stereo files (at the bottom of the fader in the lower left hand corner) and even when I double-click on t

  • Related to System Landscape of XI

    Dear All , I have a query related to the structure of system landscape of XI in the implementation project . <b>Do we create two clients for Development and QAS on the test system or we create just one client for Development and QAS  ?</b> Thanks & R

  • VERY Pleased with my Photo Books!!!!

    Since discussion boards often are overweighted with critical sentiments and questions of problems, I thought it would be worthwhile posting that I created two separate Photo Books, one of my daughter and wife, and another of my Father-in-Law's work o