Display nulls when duplicate record

Hi,
Im taking emp table as example to tell my requirement.
In emp we have the data like below
select deptno, empno from emp order by emp;
deptno empno
10 10001
10 10005
10 10034
10 10043
20 10045
20 10089
30 10088
30 10067
30 10009
But i want to display the data like below
deptno empno
10 10001
null 10005
null 10034
null 10043
20 10045
null 10089
30 10088
null 10067
null 10009
can any one help to write the query
Thanks in Advance
Edited by: Mr. Murali on Apr 15, 2011 6:22 AM

Often it's a matter of the end user tool to format the results:
SQL> select * from emp;
              DEPTNO                EMPNO
                  10                10001
                  10                10005
                  10                10034
                  10                10043
                  20                10045
                  20                10089
                  30                10088
                  30                10067
                  30                10009
9 rows selected.
SQL> break on deptno
SQL>
SQL> select * from emp order by deptno;
              DEPTNO                EMPNO
                  10                10001
                                    10005
                                    10034
                                    10043
                  20                10045
                                    10089
                  30                10088
                                    10067
                                    10009
9 rows selected.

Similar Messages

  • How to display only the duplicate records

    Hi friends,
    I have a query that provides me with a set of data,which has some duplicate rows. I require to display only the duplicates.
    This is the result I have:
    card_no cust_no address paymnt_mode
    1234 A123 XYZ CQ
    1234 A234 nmb CC
    9876 B123 mnnjn cc
    5678 A123 XYZ CQ
    5678 A123 XYZ CQ
    7876 Mk89 mku CC
    From the above ,
    I require to display something like this:(Duplicates based on card number alone)
    card_no cust_no address paymnt_mode
    1234 A123 XYZ CQ
    1234 A234 nmb CC
    5678 A123 XYZ CQ
    5678 A123 XYZ CQ
    Please share some ideas,
    Thanks a lot

    with data as
      select 1234 as card_no, 'A123' as cust_no, 'XYZ' as address, 'CQ' as paymnt_mode from dual union all
      select 1234, 'A234', 'nmb', 'CC' from dual union all
      select 9876, 'B123', 'mnnjn', 'cc' from dual union all
      select 5678, 'A123', 'XYZ', 'CQ' from dual union all
      select 5678, 'A123', 'XYZ', 'CQ' from dual union all
      select 7876, 'Mk89', 'mku', 'CC' from dual
    select card_no, cust_no, address, paymnt_mode
    from
        select card_no, cust_no, address, paymnt_mode, count(*) over (partition by card_no) as cardinality
        from data
    where cardinality > 1;
    CARD_NO                CUST_NO ADDRESS PAYMNT_MODE
    1234                   A123    XYZ     CQ         
    1234                   A234    nmb     CC         
    5678                   A123    XYZ     CQ         
    5678                   A123    XYZ     CQ          Change the column list in the partition by clause if you want to check over other columns as well.

  • Display Null when the column has a particular date value

    Experts,
    I have write the below query in Date column,
    CASE WHEN Table.Column='Bad A'
    THEN CAST(Null as "Table"."Date")
    WHEN Table.Column='Bad b'
    THEN CAST(Null as "Table"."Date")
    ELSE "Table"."Date"END
    but I am getting *" Invalid Alias Format : Table_name.Column_name required"*
    Please let me know where I did mistake.
    Thanks in Advance.
    Thanks,
    Balaa...

    Is that Table withe data column that you are using to replace the values in the main column using the case statement is an alias table or physical table? If it is alias table, you might want to try to use physical table instead.
    Thanks,
    -Amith

  • Datagrid displays null when only single item in xml via httpService

    Hi folks, I googled around for this but no luck. I've a
    datagrid populated with via httpService. The problem I'm having is
    that when there is only one item returned via the httpService, the
    datagrid doesn't display anything. However, when as soon as I add a
    second item, everything displays properly. Has anyone else
    experienced this issue? Attached is my code.
    Thanks for any help!

    "azilaga" <[email protected]> wrote in message
    news:gmq6l9$imj$[email protected]..
    > Hi folks, I googled around for this but no luck. I've a
    datagrid
    > populated
    > with via httpService. The problem I'm having is that
    when there is only
    > one
    > item returned via the httpService, the datagrid doesn't
    display anything.
    > However, when as soon as I add a second item, everything
    displays
    > properly.
    > Has anyone else experienced this issue? Attached is my
    code.
    Try setting the result format on the HTTPService to "e4x"

  • Duplicate Records error when processing transaction file....BPC 7.0

    Hi All,
    I have a situation. I am using BPC NW 7.0 and I have updated my dimension files. When I try to validate my transaction file every single record is validated successfully. But when I try to import the flat file into my application, I am getting a lot of dupplication records error and these are my questions.
    1. Will we get duplicate records in transaction files?
    2. Even if there are duplication, since it is a cube it should summarize not display that as a error and reject records?
    3. Is there something I can do to accept duplicates (I have checked the Replace option in the data package, to overwrite the simillar records, but it is only for account, category and entity only.
    5. In mycase I see identical values in all my dimension and the $value is the only difference. Why is it not summing up.
    Your quickest reply is much appreciated.
    Thanks,
    Alex.

    Hi,
    I have the same problem.
    In my case the file that I want to upload has different row that differ for the nature column. In the conversion file I map different nature to one internal nature.
    ES: cost1 --> cost
          cost2 --> cost
          cost3 --> cost
    In my desire was that in BPC the nature cost assume the result  cost = cost1 + cost2 + cost3.
    The result is that only the first record is uploaded and all other recorda are rejected as duplicate.
    Any suggestion?

  • Oracle.jbo.AttrValException: Attribute test in TestEO is required. (When trying to create duplicate Record)

    I am facing an issue when trying to create a Duplicate Record.
    Ist time when I create a record, its created Successfully.
    I have Attribute validations which should not accept duplicate values, So to check that I tried to create the record with same values to display proper warning message.
    After entering all the values (same values which i already entered in 1st record), when I tab out its showing as Red color border for that field, its expecting behaviour so no problem with that...
    Then I click on Submit or Next button, now it's showing pop-up with expected warning message along with unexpected Exception message.
    oracle.jbo.AttrValException: Attribute test in TestEO is required
    The test field is mandatory in EO, VO and .jsff.  Could any body please help me what i missed here.
    My JDEV version: 11.1.17.0
    Regards
    Gowreenath

    Hi Popz,
    Thanks for your reply. 
    I am using fnd:applicationsPanel next button as nextAction="next", so i didn't find immediate property in fnd:applicationPanel. 
    So, I tried 2 things based on your comment.
    1. nextPartialSubmit ="true"... this option is also not worked.
    2. In my Test attribute added immediate="true" this is also not worked.
    If you have any id how to set immediate property or related property in fnd:applicationPanel for nextAction.  Please let me know.
    Thanks
    Gowreenath

  • Select query-using Union All display duplicate records.

    Hello All Gurus-
    I am using Oracle 9.i
    When i use the following query to fetch the records based on BUILDNUMBERNAME and ASSIGNED_BUILD then i am getting duplicate records -
    select T1.ID FROM Defect T1,statedef T2,repoproject T3
    WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1. ASSIGNED_BUILD like '1.4.5.6'
    Union All
    select T1.ID FROM Defect T1,statedef T2,repoproject T3
    WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1.BUILDNUMBERNAME like '1.4.5.6'
    How can i use the order by on T1.ID ? When i use the Order by T1.ID then it throws some error.
    Kindly help me in this :(
    Thanks in advance.

    Sorry for not providing all of the details -
    I am using Toad tool to run the query.
    1-When i use the following query -
    Select T1.ID FROM Defect T1,statedef T2,repoproject T3
    WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1. ASSIGNED_BUILD like '1.4.5.6' order by T1.ID
    Union All
    select T1.ID FROM Defect T1,statedef T2,repoproject T3
    WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1.BUILDNUMBERNAME like '1.4.5.6' order by T1.ID
    ORA-00933: SQL command not properly ended.
    2-If i am not using the T1.ID and run the following query
    Select T1.ID FROM Defect T1,statedef T2,repoproject T3
    WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1. ASSIGNED_BUILD like '1.4.5.6'
    Union All
    select T1.ID FROM Defect T1,statedef T2,repoproject T3
    WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1.BUILDNUMBERNAME like '1.4.5.6'
    Then it is running fine but it is displaying the duplicate values like -
    00089646
    00087780
    00089148
    00090118
    00090410
    00088503
    00080985
    00084526
    00087108
    00087109
    00087117
    00088778
    00086714
    00079518
    00087780
    00089148
    00090392
    00090393
    00090395
    00090398
    00090401
    00090402
    00090403
    00090406
    00090408
    00088503
    00080985
    00084526
    00087108
    00087109
    00087117
    00088778
    00086714
    00079518

  • Is it possible to get Apple Keynote to show the presenter display instead of just the slides when I record audio using Play - Record Slideshow?

    Rather than giving a presentation with an external monitor, I want to sit at my desk and record a presentation for distribution like a podcast.  When I click record to add the sound to the presentation I see the slide show on the screen while recording instead of the presenter display.  I would like to watch the presenter display while recording so that I can see the next slide as I record.  There doesn't seem to be any way to record and watch the presenter display without having an external monitor attached.  Does anyone know how to get the presenter display to show while recording without an external monitor?

    I also needed to view presenter notes while recording a presentation on my Macbook Pro and could not find a solutions, but I did find a pretty good work around.
    I downloaded the Keynote Remote app for my iPhone.  I am now able to start recording on my laptop and then hit start slideshow on my iphone to view a portrait mode version of my slides with presenter notes below.  I use my phone to flip through slides and slide builds while I'm reading through my presenter notes.  When I've reached the end of the presentation I hit esc on my Macbook Pro and I'm done.  I'm then able to export the recorded presentation as a Quicktime video and post it on our website, which is exactly what I set out to do.
    It takes a little bit of coordination to get used to this method, but I don't need to have a projector or second monitor because my phone takes on the second monitor role.

  • SQL Loader loads duplicate records even when there is PK defined

    Hi,
    I have created table with pk on one of the column.Loaded the table using sql loader.the flat file has duplicate record.It loaded all the records without any error but now the index became unusable.
    The requirement is to fail the process if there are any duplicate.Please help me in understaing why this is happening.
    Below is the ctl file
    OPTIONS(DIRECT=TRUE, ERRORS=0)
    UNRECOVERABLE
    load data
    infile 'test.txt'
    into table abcdedfg
    replace
    fields terminated by ',' optionally enclosed by '"'
    col1 ,
    col2
    i defined pk on col1

    Check out..
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_modes.htm#sthref1457
    It states...
    During a direct path load, some integrity constraints are automatically disabled. Others are not. For a description of the constraints, see the information about maintaining data integrity in the Oracle Database Application Developer's Guide - Fundamentals.
    Enabled Constraints
    The constraints that remain in force are:
    NOT NULL
    UNIQUE
    PRIMARY KEY (unique-constraints on not-null columns)Since OP has the primary key in place before starting the DIRECT path load, this is contradictory to what the documentation says or probably a bug?

  • Add text to display when no records display

    In 'Building Reports' 21.6 which is 'Add text to display when no records display' a solution is given which involves putting boilerplate text underneath the group frame at the same level as the repeating group so that if there aren't any records retrieved the boilderplate text will be visible. My question is - is there an alternative method for achieving the same thing? i.e display the boilderplate text 'None.' if no records are returned. I have a report with a large number of frames & find the solution proposed messy & difficult to implement.
    TIA
    Simon

    The only thing you can do is make sure there is something to print. You could bas your report on a temp table which you populate with your select statement which you normally use in your report. Then after the table is populated you add the missing records in the temp table. Your report will be based upon the temp table.
    You can start this process in the after parameter form trigger by calling a PL/SQL procedure which will perform the business logic explained above.
    Marcos

  • Display message when record is save in table

    Hello,
    How can i display message as "Record Save" when record successfully save into table.
    I have created a form and take one save button, when values fill up in the textboxes and SAVE button pressed record is successfully inserted in the table then
    but how can i display popup window that "Record is save".
    Thanks in advance.

    Hi,
    your page process can have a "success message" which will be displayed after this process has finished and the page is freshly displayed (if your branch doesn't filter the process success message).
    This would be the easiest way to display "Record is save", if you want to do this in a Popup (which is oldskool...) then you can add some javascript code to your process success message.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • Display duplicate records

    Hi,
    I want to make a report which shows duplicate records in a table. We can fetch the duplicate records by using the rowid in sql but how to make it work in OBIEE? the table does not hold a unique key.

    try something similar http://carpediemconsulting.wordpress.com/2008/08/13/displaying-duplicate-values-in-obiee-reports/
    OR
    Use Direct Database Request to write direct SQLs as you do in Database

  • Display boilerplate text even when no record to display

    How would i display boilerplate text (prompt) in my repeating frame even when related query brings back 0 (zero) records ?
    Thanks,
    Greg B.

    You can't display a value in a repeating frame if the repeating frame doesn't print.
    However, you can place the same boilerplate underneath the repeating frame so that if the repeating frame doesn't print, the boilerplate underneath will still print. Make the repeating frame opaque so that the boilerplate underneath it doesn't show through if there are any records returned.
    Another alternative is to have 2 frames. The first M_R_1 to surround the repeating frame and another frame M_2 to print your boilerplate (and anything else) if the repeating frame returns no records. Place M_2 after M_R_1 and make sure they are both variable sized. Place a format trigger against M_2 so that if a row is retrieved for the repeating frame, it shouldn't print. When no records are retrieved, M_2 will move up into the space vacated by M_R_1.

  • How to create an activity when system finds duplicate record!!

    Hi CRM Experts,
    I am working on CRM 5.0. We are uploading contact details to CRM through ELM.
    Here My queries are:
    1) How to create An Activity when system finds duplicate record?
    2) By using ELM we can create BP with Activities and BP with Leads. But Here, my scenario is we have to Create BP with leads and Acivities. can any one help me on these areas?
    Thank in Advance.
    Sree

    Hi Sree,
    I can help you with your first query.
    When the system finds a duplicate record then either the system stops working further or proceeds with the error free record.
    So once the duplicate entry is found only the first record will be considered and not the second or the duplicate record.
    Regards,
    Rekha Dadwal
    Kindly reward with points if usefull !!!!

  • Duplicate record in Masterdata: Failure in Chain, Successful when manually

    Hi all,
    A daily load updates 0BPARTNER_ATTR from CRM.
    Recently this load started to fail, with the following error message:
    xx duplicate records found. xxxx recordings used in table /BI0/XBPARTNER
    The data load through PSA, but there is no red record in the PSA.
    After copying the PSA data to Excel for further analysis I concluded there are actually no duplicate in the PSA.
    Also, the option 'Ignore double data records'  in the infopackage is checked.
    When I manually update from PSA the load is successful.
    This started to happen about two weeks ago, and I didn't find an event which could have caused it.
    Now it happens every two or three days, and each time the manual update is successful.
    Any suggestions, anyone?
    Thanks, Jan.

    Hi Jan,
    Possibly you would have two requests in PSA and you would try to update the Data Target.
    Delete all the requests in PSA, schedule once again to bring the data to PSA and update then into Data Target.
    Thank you,
    Arvind

Maybe you are looking for

  • How to edit in quick mask

    I am working webdesign i am thinking to use quick mask can any one tell me what would be proper use of quick mask edit Thanks in Advance <link removed>

  • AUTOMATIC UPDATE STATISTICS for VB* tables ON automatically

    Hello All, We had reviewed our ECC system with SAP and they recommended us to OFF the AUTOMATIC UPDATE STATISTICS for VBDATA, VBHDR and VBMOD. We executed the script EXEC sp_autostats <tablename>, 'OFF' but the status goes ON after a while. Checked t

  • PA - US- IT0002 PA fillin required fields issue

    Gurus, I am trying to execute a personal action to "Hire an employee" When I get to the Personal Data, I get a popup message "fill in all requied fields" As far as I know, only first name, last name and the DOB is required here - right? I also tried

  • Call Library Function Running slow

    Hi I'm using a third party IO board for DAQ experiment. To create a real-time DAQ VI I used the DLL file which's supplied by the manufacture, I managed to get the VI working to read from the board by using the Call Library function. But the vi runnin

  • Phone won't remember accounts!

    So I lost battery life and somehow it won't remember my passwords to any of my accounts after a reboot.  Some won't remember the password no matter how many times I enter it, like the Mail for Exchange accounts. Anyone have any idea what's going on?