How to avoid duplicat just one column

Hi,
I've this table:
COD_ID.........NAME
001............AAAA
001............AAAA
001............AAAA
011............CCCCCCC
011............CCCCCCC
011............CCCCCCC
011............CCCCCCC
032............FFFFF
032............FFFFF
223............TTTTTTTTTT
223............TTTTTTTTTT
223............TTTTTTTTTT
223............TTTTTTTTTT
223............TTTTTTTTTT
223............TTTTTTTTTT
I'd like to get this output:
COD_ID.........NAME
001............AAAA
...............AAAA
...............AAAA
011............CCCCCCC
...............CCCCCCC
...............CCCCCCC
...............CCCCCCC
032............FFFFF
...............FFFFF
223............TTTTTTTTTT
...............TTTTTTTTTT
...............TTTTTTTTTT
...............TTTTTTTTTT
...............TTTTTTTTTT
...............TTTTTTTTTT
I want have just one cod_id for each name and null cod_id for other cod_id.
Have you any idea?
Thanks!

use the BREAK on sql*plus.
SQL> select * from emp;
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
      7566 JONES      MANAGER         7839 02-APR-81       2975       1000         20
      7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
      7839 KING       PRESIDENT            17-NOV-81       5000                    10
      7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
      7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
      7369 SMITH      CLERK           7902 17-DEC-80        800                    20
      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
      7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20
      7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
      7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20
      7900 JAMES      CLERK           7698 03-DEC-81        950                    30
      7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
14 rows selected.
SQL> break on deptno;
SQL> select deptno, empno, ename, job
  2    from emp
  3  order by deptno;
    DEPTNO      EMPNO ENAME      JOB
        10       7839 KING       PRESIDENT
                 7782 CLARK      MANAGER
                 7934 MILLER     CLERK
        20       7566 JONES      MANAGER
                 7369 SMITH      CLERK
                 7902 FORD       ANALYST
                 7788 SCOTT      ANALYST
                 7876 ADAMS      CLERK
        30       7698 BLAKE      MANAGER
                 7499 ALLEN      SALESMAN
                 7521 WARD       SALESMAN
                 7900 JAMES      CLERK
                 7844 TURNER     SALESMAN
                 7654 MARTIN     SALESMAN
14 rows selected.
SQL>

Similar Messages

  • How to change font in just one column of JTable

    I have a table with 4 column.
    I want to have Courier font in column number 2, and Arial in columns number 1, 3 and 4.
    With:
    table.setFont(new Font("Courier New", Font.PLAIN, 12));
    I can set fonts in all columns but how to set font in just one column.
    Thanks
    Srdan

    Hi,
    there are 2 methods of JTable where every rendering resp. editing component "comes" through - prepareRenderer(...) and prepareEditor(....) - by overwriting this methods and calling its super method first you get the component and can manipulate it before you return it. This component is exactly that, what is used for rendering resp. editing afterwards.
    greetings Marsian

  • How To Insert Cells Into One Column Only

    Can anyone advise me, how to insert a cell (or multiple cells) into +just one column+ whilst leaving everything else on the sheet exactly as it is?
    I'm migrating from Excel and can't find this functionality in Numbers
    Thanks in advance for any help

    Thank you for taking the time to reply, thereby removing the misery of me continuing to search for this absent function!
    I really wanted to like the iWork apps! I recently rebuilt one of my rigs and had the intention of making it a Microsoft-free computer - hence the purchase of iWork.
    However, the last few days of 'learning curve' I have stumbled upon an increasing number of incompatibilities and limitations when compared to Excel, and the lack of the function to insert a single cell into a sheet is the final deal-breaker for me, sadly.
    So, reluctantly, I am going to install my Microsoft Office 2008 suite and get back to where I was before. I will continue to look at the iWork apps but I suspect they'll fall to the wayside.
    Once again, many thanks for confirming what I was reluctantly concluding.

  • How to avoid Duplicate Records  while joining two tables

    Hi,
    I am trying to join three tables, basically two tables are same one is like history table, so I wrote a query like
    select
    e.id,
    e.seqNo,
    e.name,
    d.resDate,
    d.details
    from employees e,
    ((select * from dept)union(select * from dept_hist)) d
    join on d.id=e.id and e.seqno=d.seqno
    but this returing duplicate records.
    Could anyone please tell me how to avoid duplicate records of this query.

    Actually it is like if the record is processed it will be moved to hist table, so both table will not have same records and I need the record from both the tables so i have done the union of both the tables, so d will have the union of both records.
    But I am getting duplicate records if even I am distinct.

  • Create an object for just one column in resultset?

    Does it make sense to return a result set of one column into an object that represents that table? It seems like a waste of memory, but maybe I am missing something. Also all generic DOA's I have found don't deal with this situation, so maybe someone can help me with how I think about this problem in my design. Thanks for the thoughts.

    >
    Plan B is to just return a list of Strings instead of a list of "some object". The issue with this is the ease of creating a generic DAO that is easy to program to. Having a DAO for each "table" class seems to be the best practice that is offered out there.
    >
    Well a String IS an object.
    From an architecture perspective you should model a table as a table. So if you have a table of one column you should still model it as a table. A table is a table is a table and you should generally treat it as such until or unless there is a compelling reason not to.
    If you step back from the 'implementation' and refocus on the 'design' and requirements one of those requirements is to identify the sources of data that your application needs. Sounds like that data, at the server level is in a table and the typical interface between an application and a database is via tables. Makes no difference if you need one row or 1000, one column or 30 columns the first focus is on the data source.
    So the interface between an application, in your case a Java app, and a database server will generally involved tables. That means you should probably still use a standard DAO (I assume you mean Data Access Object).
    A generic table DAO would typically have functionality to deal with tables and not just an arbitrary object. It would have getters and setters, functionality to support multiple rows and might even know about columns.
    In good data models tables almost never have just one column. Even a simple lookup table usually has an ID or CODE column and then a value column for the actual data. So if that one column table suddenly becomes two or more columns you will have to refactor your entire architecture to then use a standard DAO.
    That is why the statement you made is true.
    >
    Having a DAO for each "table" class seems to be the best practice that is offered out there.
    >
    Unless you have some real reason not to I suggest you stick with that practice. That will make you code more scaleable and more consistent.
    From an architecture perspective.

  • How to avoid duplicate data while inserting from sample.dat file to table

    Hi Guys,
    We have issue with duplicate data in flat file while loading data from sample.dat file to table. How to avoid duplicate data in control file.
    Can any one help me on this.
    Thanks in advance!
    Regards,
    LKR

    No, a control file will not remove duplicate data.
    You would be better to use an external table and then remove duplicate data using SQL as you query the data to insert it to your destination table.

  • How can i print just one page of photo book without printing the entire book

    how can i print just one page of photo book without printing the entire book

    Jim,
    Take heart.  We can help.
    First turn on page view so you can see how the content of your sheet fits on the page(s).  A Numbers document contains sheets (listed on the left) which in turn contain tables, charts, text, and graphics.  Select the sheet you want to print on the left, then enable page view by selecting the menu item:
    "View > Show Print View":
    Now you should see your content and how it fits on one, or more, pages.  If thie content is too big for one page use the controls and the bottom left of the window to expose the sheet controls:
    Here a table is too big to fit on one page:
    slide the "Content Scale" slider so the content fits:

  • HT3819 How do I share just one movie (not my entire library) from my itunes library with an authorized computer using home sharing?

    How do I share just one movie (not my entire library) from my itunes library with an authorized computer using home sharing?

    many thanks.
    That should be possible.
    From his library connect to your library via Home Sharing.
    Select the name of the shared library in the source pane of your itunes, and click on the wee disclosure triangle to the left of the name of the library. Does "Films" appear beneath the name of the library?
    Here's a screenshot of what I mean.
    Select "Films". In the right-hand pane you should see the item you want to transfer. Just select that item, and click "Import".
    Use the same basic technique to get one or a few songs from your library transferred to his library. (The only difference is that you would have "Music" selected instead of "Films".
    If you don't want him to have access to other items in your library, you could just switch Home Sharing off on his library after you've done the transfers.

  • How can I publish just ONE site

    Everytime I create a new site and publish it to a folder (to place in my own domain) iWeb publishes ALL of the sites every time, no matter whether changes have been made to any site or not.
    How do I publish just ONE site?
    If I get mobile.me, will I be able to publish just the ONE site I wish to publish?
    Phil

    I use iWebSites to manage multiple sites.. It lets me create multiple sites and multiple domain files.
    If you have multiple sites in one domain file here's the workflow I used to split them into individual site files with iWebSites. Be sure to make a backup copy of your original Domain.sites files before starting the splitting process.
    This lets me edit several sites and only republish the one I want.
    OT

  • How do i open just one file at a time

    i just got lightroom 4.  how do i open just ONE FILE??  i don't want to open catalongs, backup files, create smart collections auto import or any of that.  i just want to open one file at a time

    jared54 wrote:
    i just want to open one file at a time
    You want Photoshop or Elements and use the ACR plugin. Lightroom is the wrong application for you; square peg in a round hole and all that.

  • How do I select just one audio channel in Final Cut Pro X?

    I know this has been asked and answered somewehre... and I'm pretty sure the answer is simple. But I don't have hour's to search the net.
    And the FCPX "Help" feature just ****** me off....
    I recorded voice on channel 2 and shotgun nat.sound on channel 1.
    I only want the voice track (channel 2) to playback in stereo.
    I have already edited the video so I don't want to re-import the raw video to seperate out just the channel 2 voice track.
    How do I select just one audio channel in the timeline, then pan it so it plays back in both the L and R channel?
    Also, some of the audio was recorded with a air conditioner running in the background.  Any suggestions on best audio filers to remove or lessen it?
    Thanks, Barry

    I think you want to select the clip in the Timeline, choose the Inspector and then Audio, dual mono.
    You can even do this by selecting multiple clips.
    In the Event Browser as well.

  • How to avoid duplicate posting of noted items for advance payment requests?

    How to avoid duplicate posting of noted items for advace payments request?

    Puttasiddappa,
    In the PS module, we allow the deletion of a component pruchase requisition allthough a purchase order exists. The system will send message CN707 "<i>A purchase order already exists for purchase requisition &</i>" as an Iinformation message by design to allow flexible project management.
    If you, however, desire the message CN707 to be of type E you have to
    modify the standard coding. Doing so, using SE91, you can invoke the
    where-used-list of message 707 in message class CN, and to change the
      i707(cn)
    to
      e707(cn)
    where desired.
    Also, user exit CNEX0039 provides the possibility to reject the
    deletion of a component according to customers needs e. g. you may
    check here whether a purchase order exists and reject the deletion.
    Hope this helps!
    Best regards
    Martina Modolell

  • How do I print just one page of a .pdf using the android e-Print app?

    How do I print just one page of a .pdf using the android e-Print app?

    Hello,
    I see that you're having an issue with printing just one page from the E-print app. 
    Unfortunately, on an android device, you do not have the feature to select how many pages you want to print 
    Thanks!

  • How to display more than one column with for each

    Hi guys,
    how to display more than one column with for each like below?
    for each
    Item1
    Item2
    Item3
    Item4
    Item5
    Item6
    Item7
    Item8
    Item9
    Item10
    End for each
    for each          
    Item1     Item2     Item3
    Item4     Item5     Item6
    Item7     Item8     Item9
    Item10          
    End for each

    Take a look at this to see if the solution provided would work for you: https://blogs.oracle.com/xmlpublisher/entry/multi_column_row_woes
    Won't you have more than 10 records in your data file ? If you are going to have only 10 items then you may be able to use position() function to limit it to 3 each..
    Take a look at this: https://blogs.oracle.com/xmlpublisher/entry/turning_rows_into_columns
    Thanks,
    Bipuser

  • How can I Make just one color pop and the rest a black and white photo??

    How can I make just one color pop and the rest of the photo black and white?? I'm using iphoto...

    3rd party image editors like Photoshop Elements for Mac can do it:
    Click to play video screenshot
    Or use it to keep an object in color and the rest B/W.
    Click to view full size
    OT

Maybe you are looking for

  • Publishing bw workbooks to the portal

    I am trying to find out what portal role a bw designer would need in order to publish workbooks\queries to KM in the portal and also to publish reports as an iview.  We have a few bw folks who are trying to accomplish this.  In the portal I had assig

  • Macintosh Quadra 840AV, problem with startup

    Hey all, I got a brand new (old) Macintosh Quadra 840AV computer from my friend. I acquired it with powermac 8100 mainboard on deck, and then it started good, I had a signal on monitor and system started up. When I put an original 840AV mainboard it

  • How to configure Time-sheet in Project server 2013 please share the doc with screen shot

    How to configure Time-sheet in Project server 2013 please share the doc with screen shot Thanks and Regards, Rangnath Mali

  • Maintainence View Problem

    I have created a ztable, and have used that table in maintainence view, but when i use that view in sm30 for entering the data, one of the field description is not coming it is just showing '+' ., what would be the problem .

  • Problem in using the itouch while it's charging.

    Hi, I've got a problem while using my Itouch4g, when it is charging. While charging and operating the Itouch, the screen wiggles like the icons do when you want to either shift or delete them! Can't chat or play games while the Itouch is charging. Is