Distinct for only one column

Hi,
I want select only distinct column of one column while at the same time displaying the other column attributed to the selected column.
e.g. select name
from student
where name in
(select distinct name from student)
and processing_date >= '20070701'
and processing_date < '20070702'
this list all the similar rows and the distinct. Please assist. Thanks

I'm sorry, but I am still a confused. Your current query, as written, is logically equivalent to...
SELECT name, address
FROM   student
WHERE  processing_date >= '20070701'
AND    processing_date <  '20070702';since selecting the DISTINCT names from the same table will match on every row.
Are you looking for the DISTINCT names and addresses?
SELECT DISTINCT name, address
FROM   student
WHERE  processing_date >= '20070701'
AND    processing_date <  '20070702';Or are you looking for output like this?
Bill Johnson   123 Main Street
               456 West Lane
John Doe       222 Hill Stree
               888 East AvenueAgain, some sample output would be helpful.
Greg

Similar Messages

  • EA2: Code is generated for only one column with Domain check constraint.

    I created a Domain with a Value List (Y or N - Yes or No) and used that domain for two columns in the same table. But for only one column (the last one) the check appears in the generated DDL.
    After I enabled the "Use Domain Constraints" both checks appear in the DDL, but one as an inline check constraint and one as an "Alter table add contraint.."
    Once I changed the naming Template for the check constraint, both constraints are generated as an Alter table clause. The inline check constraint is only generated when the name of the constraint (according to the template) is too long. It would be nice if I could choose if I want an inline or a separate check constraint definition.
    Edited by: Roel on Nov 23, 2010 11:55 AM
    Edited by: Roel on Nov 23, 2010 12:02 PM

    I logged ER for that
    Philip

  • Set filter for only one column in tableview

    Hi
    i am using in MVC a htmlb:tableview with filter in only one column of 8.
    This is all working fine, except that the user can enter a searchsting in the filterfield for all columns, but in handle_event (of the controller) ; i only react to a text in the filterfield of column 4 and ignore all other filtertext , which were maybe entered in the other columns.
    My question:
    how can i  enter the filter only for one column, in a way that the user cannot enter any text in the filterfield of the other columns, only in column 4 ?
    my view:
    <htmlb:tableView id             = "requirements"
                     table          = "//model/pdst_reqs"
                     filter         = "APPLICATION"                
                     keyColumn       = "EXTID"
                     iterator        = "<%=model%>"
                     footerVisible   = "FALSE"
                     encode          = "TRUE"
                     visibleRowCount = "<%=model->rowcount%>"
                     width           = "100%"/>
    Best Regards
    Britta

    You can disbale the Filter for the particular column by setting the DISABLE_FILTER in the Iterator method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS. Here is the sample code
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
      CLEAR p_column_definitions.
      CLEAR p_overwrites.
      data tv_column TYPE TABLEVIEWCONTROL.
      tv_column-COLUMNNAME          = 'FLDATE'.
      tv_column-SORT                = 'X'.
      tv_column-EDIT                = 'X'.
      tv_column-ONCELLCLICK         = 'MyCellClick1'.
      tv_column-title               = 'Date '.
      APPEND tv_column TO p_column_definitions.
      CLEAR tv_column.
      tv_column-COLUMNNAME          = 'PRICE'.
      tv_column-horizontalAlignment = 'right'.
      tv_column-verticalAlignment   = 'middle'.
      tv_column-ONCELLCLICK         = 'MyCellClick2'.
      tv_column-title               = 'Currency'. 
      tv_column-EDIT                = 'X'.
      tv_column-DISABLE_FILTER      = 'X'.    " <-------Like this
      APPEND tv_column TO p_column_definitions.
    endmethod.
    Hope this will solve your problem.
    Raja

  • Mysql 'distinct' syntax for only one column

    I want to select an entire table and limit the results to those rows which have distinct information in a particular column.
    for example:
    ID
    main_category
    sub_category
    1
    letter
    t
    2
    letter
    s
    3
    letter
    s
    4
    letter
    t
    I want to create a mysql sntax statement that collects all the columns (i.e. SELECT * FROM my_table) yet only selects the distinct cells of 'sub category' to only display the letters 's' and 't' (when using the php code "echo $row_exampleRS['sub_category']" on a repeating loop).
    When I use the statement "SELECT DISTINCT * FROM my_table" it returns 't', 's', 's', 't' because I didnt set the DISTINCT on sub_cateogry
    How do I SELECT all the columns yet limit one of those columns to only distinct entries??
    thanks

    >1) I need to select the ID as well for another reason.
    Which ID? All of them? Some of them?   The select statement will retrieve columns and rows from the table. If you want it to select all of the ID's, then it would need to select all of the other values associated with that row, including 'duplicates'.
    Now, if you only want to select some of the ID's, so that the other columns are not duplicated, you can do that - but you need to tell SQL how to decide which rows to return. You could use max or min or some other aggregate.
    >using only 'second' in GROUP BY seems to have done the job.
    Be aware that using only part of your select list in the group by clause is known to cause unexpected results, and is not syntactically or logically valid. Note that most DBMS's would return an error. For some reason, MySQL chooses to not return an error, but the results may be unexpected. So it may work now, but you may get strange results later.

  • Delete Array Duplicate for only one column

    Hi all,
    So I am trying to work out a problem here. I have searched the forums but I have not found anything that works for me. Here is my issue.....I have an array (converted from a .csv file) with many rows and columns. Each row is a logfile for a particular serial number. The amount of columns is fixed. But, I need to create a vi to go through the array and remove the duplicates below the original and create a new array.. For example, my array could look like this (I added a desc header for clarity):
    Job, Tech, SN
    1827, SJ, 23827
    1825, SJ, 23827
    1827, SJ, 47384
    1827, SJ, 57483
    1827, SJ, 37473
    1825, SJ, 37473
    But i want an appended array like this:
    Job, Tech, SN
    1827, SJ, 23827
    1827, SJ, 47384
    1827, SJ, 57483
    1827, SJ, 37473
    Can anyone help me out?
    Thanks,
    Ryan
    Solved!
    Go to Solution.

    Assuming that the identical serial numbers are adjacent as in your example, here's what I would do.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RemoveDuplicates.png ‏22 KB
    removeDuplicates.vi ‏11 KB

  • Access for update only one column in table?

    Hi all,
    My need is to grant access for update only one column c1 in table t1.
    I guess I should use view, could you please give me some example? Maybe other ideas?

    Hi,
    You can grant privileges on individual columns.
    GRANT   UPDATE (c1)
    ON      t1
    TO      grantee_name;Look up GRANT in the SQL language manual. Annoyingly, in recent editions of the manual, GRANT is not indexed, but it's in alphabetic order with all the other statements:
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_9013.htm#i2155015

  • Select distinct('more than one column') from ....

    Why does this sql statement not work:
    select distinct(column_a, column_b, column_c), empno
    from emp;
    How can I 'select distinct' using more than one column.

    Actually, DISTINCT applies to all columns in the result.
    Distinct is not a function, you cannot do distinct(column1, column2, ...).
    As a matter of fact it doesn't make sense to expect distinct applies to only one column, because you do not specify any criteria on how to select the values for the second column.
    A final note: you can do distinct(column1), column2, but this will still apply to both columns!
    Here're some examples that will all return both rows from the set, where set is: (1,1), (1,2):
    select distinct val1, val2
    from
    select 1 as val1, 1 as val2 from dual
    union all
    select 1 as val1, 2 as val2 from dual
    select distinct val1||'-'||val2
    from
    select 1 as val1, 1 as val2 from dual
    union all
    select 1 as val1, 2 as val2 from dual
    select distinct(val1), val2 -- this is very misleading. distinct still applies to both columns
    from
    select 1 as val1, 1 as val2 from dual
    union all
    select 1 as val1, 2 as val2 from dual
    Edited by: user4010726 on Dec 1, 2009 11:06 AM
    Edited by: user4010726 on Dec 1, 2009 11:07 AM

  • Removing header, border for only single column in mx:DataGrid

    Hi,
        I am using Flex4 SDK and FlashBuilder4.
    I have a requirement where i need to remove column header, borders and grid lines for only last column in datagrid.
    It should look like there is no column present. This column will be used to show some icon for only selected row.
        Can any one suggest how to implement this. Please provide any sample if you can.
    Thanks

    hi Johnny, it was helpfull for me.
    With the given example i am still getting the grid line gaps with the selected row or hover color between verticle cells of the column.
    As gridlines can only be removed for complete datagrid not for a single column. is it possible ?
    Thanks

  • Can I show a data label for only one point in a series?

    Forgive a newbie question from an Excel convert, but can I show a value label for only one point in a data series? If yes, how?
    There are a number of graphs where I only want to value of either an extreme value or the ending value to show. Having all the labels in a series makes the chart too busy. This is pretty easy to do in Excel.
    If this can't be done, I guess that adding a text box over those points would work.
    Thanks

    Hi W-T,
    Welcome to Apple Discussions and the Numbers '09 forum.
    wahoo_tiger wrote:
    Forgive a newbie question from an Excel convert, but can I show a value label for only one point in a data series? If yes, how?
    Sure. Here's and example labeling only the MIN and MAX points.
    Column B contains the data charted with the blue line.
    Column C extracts the MIN and MAX values using the formula below. Those two values are charted as a separate series, using the green data point markers, and are labeled with their values. The intervening empty string values appear to have doused the lines connecting the two data points.
    Formula: =IF(OR(B=MAX(B),B=MIN(B)),B,"")
    Regards,
    Barry

  • Changing DB character set for only one schema

    We are interested in changing the characterset of only one user from Western European to AL32UTF8.
    Could you please verify if the following steps will be correct to do the same.
    1. Run CSScan on the one user
    2. Fix any issues
    3. Export that one user (with NLS_LANG set to <your old database character set>)
    4. Create a new database in the AL32UTF8 character set
    5. Import that one user into the new database (with NLS_LANG set to <your old database character set>)

    Actually your title is a little incorrect. You are not changing CS for only one schema in existing DB which is not possible. You are trying to migrate a schema to new CS DB. Which is totally doable and your approach is mostly correct.
    Database Character Set Scanner provide user scan mode
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch12scanner.htm#i1006013
    Mostly the issue could be data truncation, especially if you have column defined using char or varchar2 vs nchar and nvarchar2
    because char/varchar is defined in bytes, AL32UTF8 is multi-bytes char set, some character of your old data could saved more than 1 bytes in new DB and can't fit into the column size.

  • How to make only one column non reorderble

    I want to make only one column (Column 0) of my JTable non reorderble.
    I also want to make the same column non resizable and I want to give it a specific size.
    Please help me on this?

    I have implemented a RowHeaderTable class which displays 1, 2, 3, ... in the first column. The column is in the scrollpane's RowHeaderView, so it is not resizable nor reorderable. But its width can be set in your code. Maybe this is what you need.
    Use the class the same way you use a JTable, except 3 added methods:
    getScrollPane();
    setMinRows(int r);
    setRowHeaderWidth(int w);
    Note: The table works perfectly in skinless L&F, such as the default java L&F. It looks ugly in Liquid L&F because I don't know how to steal column header's UI to use on a JList. If someone can help me on this one, I thank you in advance.
    * RowHeaderTable.java
    * Created on 2005-3-21
    * Copyright (c) 2005 Jing Ding, All Rights Reserved.
    * Permission to use, copy, modify, and distribute this software
    * and its documentation for NON-COMMERCIAL purposes and without
    * fee is hereby granted provided that this copyright notice
    * appears in all copies.
    * JING DING MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
    * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
    * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
    * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. JING DING
    * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT
    * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
    import java.awt.BorderLayout;
    import java.awt.Component;
    import javax.swing.AbstractListModel;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.ListCellRenderer;
    import javax.swing.UIManager;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    import javax.swing.table.TableModel;
    * @author Jing Ding
    public class RowHeaderTable extends JTable {
      private int minRows = 10;                         // Minimum size of the row header.
      private static final int DEFAULT_WIDTH = 30;
      private JScrollPane jsp;
      // The row header is a JList with the same appearance as the column header.
      private JList rowHeader;
      // Repaint row header whenever the table inserts or deletes rows.
      private TableModelListener tmListener = new TableModelListener(){
        public void tableChanged(TableModelEvent e){
          if(e.getType() != TableModelEvent.UPDATE)
            rowHeader.repaint();
      /** Create a new instance of RowHeaderTable.
       * @param model
      public RowHeaderTable(TableModel model){
        setModel(model);
        initializeHeader();
        jsp = new JScrollPane(this);
        jsp.setRowHeaderView(rowHeader);
      private void initializeHeader(){
        rowHeader = new JList(new AbstractListModel(){
          public int getSize(){ return Math.max(getModel().getRowCount(), minRows); }
          public Object getElementAt(int index){ return "" + ++index; }
        setRowHeaderWidth(DEFAULT_WIDTH);
        rowHeader.setFixedCellHeight(getRowHeight());
        rowHeader.setCellRenderer(new TableRowHeaderRenderer());
      public void setRowHeaderWidth(int w){
        rowHeader.setFixedCellWidth(w);
      public void setMinRows(int m){ minRows = m; }
      public void setModel(TableModel model){
        super.setModel(model);
        model.addTableModelListener(tmListener);
      /**Use this method to get the scrollPane, instead of new JScrollPane(table).
       * @return
      public JScrollPane getScrollPane(){ return jsp; }
      protected class TableRowHeaderRenderer implements ListCellRenderer{
        TableCellRenderer colHeaderRenderer;
        public TableRowHeaderRenderer(){
          JTableHeader header = getTableHeader();
          TableColumn aColumn = header.getColumnModel().getColumn(0);
          colHeaderRenderer = aColumn.getHeaderRenderer();
          if(colHeaderRenderer == null)
            colHeaderRenderer = header.getDefaultRenderer();
        public Component getListCellRendererComponent(JList list, Object value,
            int index, boolean isSelected, boolean hasFocus){
          return colHeaderRenderer.getTableCellRendererComponent(
              RowHeaderTable.this, value, isSelected, hasFocus, -1, -1);
      public static void main(String[] args){
        try {
          UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");
        }catch (Exception e){ e.printStackTrace(); }
        String[] columnNames = {"First Name",
            "Last Name",
            "Sport",
            "# of Years",
            "Vegetarian"};
              Object[][] data = {
                   {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)},
                   {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)},
                   {"Kathy", "Walrath", "Knitting", new Integer(2), new Boolean(false)},
                   {"Sharon", "Zakhour", "Speed reading", new Integer(20), new Boolean(true)},
                   {"Philip", "Milne", "Pool", new Integer(10), new Boolean(false)}
        DefaultTableModel dtm = new DefaultTableModel(data, columnNames);
        RowHeaderTable rht = new RowHeaderTable(dtm);
        rht.setMinRows(0);
        JFrame frame = new JFrame("RowHeaderTable Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(rht.getScrollPane(), BorderLayout.CENTER);
        frame.pack();
        frame.setVisible(true);
        dtm.addRow(new Object[]{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)});
        dtm.addRow(new Object[]{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)});
        dtm.addRow(new Object[]{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)});
    }

  • Copy only one column  of the workbook1  and paste it in another workbook 2

    Hello Rishi. Please help me with this how to copy only one column C of the workbook1  and paste it in another workbook 2 in Column D so that When user execute workbook1 . and then execute workbook2 . Column D is automatically populated in Workbook2 based on the data in Column C in workbook 1
    Please help
    Thanks
    Soniya

    Hi Soniya
    As I mentioned earlier, I haven't come across a situation of copying data from one workbook to another. However, for doing some dynamic modifications within the different sheets of the same workbook, you can refer to the following thread:
    Comparing two queries with VBA macro
    Thanks,
    Rishi

  • How can I correct that emails for only one of my address going direct to my trash file before even being read and this just started a while back not before?

    have been living with this for a while, do not remember when it started and have already try different ways a solving the problem but nothing has corrected the situation.

    thanks for ur suggestion, no help. still goes to trash for only one of my email addresses, other two no problem.

  • Tacacs authentication fails for one user account for only one switch

    Hi,
    I am having an scenario, where as Tacacs authentication fails for one user account for only one switch.
    The same user account works well for other devices.
    The AAA configs are same on every devices in the network.
    Heres the show tacacs output from the switch where only one user account fails;
                  Socket opens:        157
                 Socket closes:        156
                 Socket aborts:        303
                 Socket errors:          1
               Socket Timeouts:          2
       Failed Connect Attempts:          0
            Total Packets Sent:       1703
            Total Packets Recv:       1243
              Expected Replies:          0
    What could be the reason ?
    No errors on ACS server; same rights had been given to the user account.
    Thanks to advise.
    Prasey

    Hi there,
    Does the user get authenticated in the ACS logs?
    reports and activity----> failed attempts
    ro
    reports and activity----->  passed authentications
    That will help narrow it down.
    Brad

  • Apple apps store do double charged me for only one application purchased and i can't find an email of apple customer service.

    Apple apps store do double charged me for only one application purchased and i can't find an email of apple customer service.
    <Email Edited By Host>

    These are user-to-user forums - I've asked the hosts to remove your email address from your post.
    Tou can contact iTunes support here : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

Maybe you are looking for

  • Where did the AirPlay button in the video app go in iOS 8?

    I Used the quick AirPlay button in the video app quite often. I just upgraded to iOS 8. I noticed that it is gone. Am I missing it anywhere?  Why would this be removed?

  • How to convert any date format?

    Hi, In the BPEL process I am getting the input in 'DD-MON-YYYY' format, I want to convert it to 'DD-MM-YYYY' format. The function xp20:formatDateTime('string', 'image') expecting the string to be in 'YYYY-MM-DD' format. and the 'image' can be set to

  • Sorting in Supplier check printing

    Hi Guru's, I have developed the supplier check printing Template and its working fine. The client wants the report sorted by the check number. Iam not able to sort it <?sort:Checknumber?>by using this command. Need some help.Its Pretty critical

  • Draw on TiledImage as one unified image, still managing memory using tiles

    what I am looking for is **exactly** this http://www.garayed.com/java/186952-question-about-tiledimage-graphics2d-jai.html "(...)How do I create an arbitrarily large TiledImage from scratch (lacking a source image) and draw onto it using the TiledIma

  • [Solved] irexec: could not connect to socket

    I am trying to start irexec via .xinitrc which has worked fine for me pre-systemd, but now I am getting the following error: irexec: could not connect to socket irexec: no such file or directory Lirc is running fine, remote works in mythtv. Here's my