SEPARATE, only for some columns

Hi guys!
I have a table in which I have to get the separate results of the first 5 columns and attach it with the 6th column. I mean it would be something like this:

Select distinct (col1, col2, col3, col4, col5), col6 table...

I can't do the distinct only in some columns (because if I want to that they accordingly I do the separate for each other each other)... How can I do this?

It would be something like this:
Select distinct (col1, col2, col3, col4, col5), col6 table...

no doubt:

select *
  from (select col1,
               col2,
               col3,
               col4,
               col5,
               col6,
               row_number () over (partition by col1, col2, col3, col4, col5 order by null) rn
          from table1)
 where rn = 1

Tags: Database

Similar Questions

  • Select grant to user only to some columns. Is this possible?.

    Good night:

    I learn about the roles and privileges.

    I tried to limit the right to select on a table for only some columns of it.
    Unfortunately, it does not work.

    GRANT select (employe_id, last_name, job_id)
    ON hr.employees
    To Usuario_2;

    It is an ORA-00969: falta the word clave market (ON the keyword is missing)

    Surprisingly, it does not work with updates.

    Update (employe_id, last_name, job_id) GRANT
    ON hr.employees
    To Usuario_2;

    "Treated phrase."

    Could someone tell me if it is possible access of the users with 'select' only some columns do not use views? If its possible. What I am doing wrong?

    Greetings

    You can't give Annie with specific column. You can do so only to updating, inserting, and references.
    Other ways is to use the DPV or views (but SPV is not the XE version)

    You can read this topic: GRANT SELECT on the selected columns

    Edited by: AndyPol 2010-02-01 23:48

  • Identification of duplicates of 100% and duplicates only for key columns.

    Hello

    So far I have gathered these two tables:

    NAME | TASK | MISSION
    1 John 2
    1 John 2
    2 three Mike
    2 four Mike


    NAME | TASK | MISSION
    1 two Bob
    1 two Bob
    2 three Paul
    2 Paul four

    The result is
    NAME | TASK | MISSION
    1 John 2
    1 John 2
    2 three Mike
    2 four Mike
    1 two Bob
    1 two Bob
    2 three Paul
    2 Paul four

    What I need is I want to mark lines that are duplicates of 100% and who lines
    There's duplicates ONLY for the key of the fields NAME, TASK.

    How can I do this?

    metalray wrote:
    The only thing that that concerns me is the among of the typeing what I should do to get this
    made for my 85 + no key columns.

    You could always concatenate columns in a 75% and 100% of grouping in a subquery and run external applications, we have developed here against it.

  • DG4ODBC configured and working but receiving ORA-28528 for some columns

    DG4ODBC is configured and working for XE 11 GR 2, but under some circumstances receiving SQL Error: ORA-28528: heterogeneous Services data type conversion error.

    Configuration: DG4ODBC configured for Oracle 11 g 2 using ODBC datasource based on IBM UniVerse ODBC Driver 4.00.04.7346 UVODBC. DLL (25/08/2009), all on the same host 32-bit Windows designed to extract data from remote AIX based IBM/Rockit universe version 10.1 of the database.

    After 3 orders with matching results illustrate the problem:

    Select NO_PROD from bill_mat@dblink, including NO_PROD not in ('15', '20', '24', '6',' 10');

    no selected line


    Select NO_PROD, count (*) from bill_mat@dblink where NO_PROD Group ('15', '20', '24', ' 6', ' 10') of NO_PROD;

    NO_PROD COUNT (*)
    ---------- --------
    6 1
    20 1
    24 1
    9 out of 10
    15 1

    Select NO_PROD in the bill_mat@dblink;

    Error at startup on line 19 of order:
    Select NO_PROD from bill_mat@dblink
    Error report:
    SQL error: ORA-28528: heterogeneous Services data type conversion error
    ORA-02063: preceding line of DBLINK
    28528 00000 - "heterogeneous Services data type conversion error."
    * Cause: Is a type of data Oracle could not be converted to a non-Oracle
    data type, or a type of data non-Oracle could not be converted
    for an Oracle data type. Here are the possible reasons
    the failure of the conversion:
    -overflow problems (in the case of numbers)
    -the limits of length (in the case of strings)
    -invalid values passed in the conversion routines
    * Action: Contact customer support of the agent vendor. If the problem is
    due to differences in size between Oracle and the non-Oracle system.
    It is not possible to convert the value.


    LIST universe queries shows many ' white' values for both fields LST.WO & no PROD that issue when trying to query through DG4ODBC, in the case of the subjects table "BILL_MAT":

    LIST BILL. MAST LST.WO No. LOCK PROD 16:08:44 November 22, 2011 PAGE 11
    BILL. MAST... LST.WO... MOM PROD LOCK

    239912 10
    220419
    247992
    252739
    249709
    239913 15
    184767
    164264
    184666
    164265
    247994
    239914
    251731
    249711
    173760
    239915 20
    242137
    247490
    247894
    254156
    Press a key to continue...



    Interestingly, the output of this test JDBC application is different, including references to "null" values "in white" referred to as with output LIST above:

    import java.sql. *;
    import java. IO;

    public class billmat {}

    Public Shared Sub main (String [] argv)
    {
    try {}
    BufferedReader in = new BufferedReader (new InputStreamReader (System.in));



    //---------------------------
    Connect to the server U2
    //---------------------------

    Chain account = "universe_account";
    String userid = "username";
    String passwd = "password";
    String host = "AIX_Host";
    String url = "jdbc:ibm-u2://"+host+"/"+account+"?tracelevel=5;tracefile=qiang.trace";

    Load the driver and connect to the server
    Class.forName ("com.ibm.u2.jdbc.UniJDBCDriver");
    Connection con = DriverManager.getConnection (url, username, passwd);

    System.out.println ("successful - \n\t*---connexion * \n");


    System.out.println ("1. Select the file Bill. MAT ------------------------");
    testQuery (con);


    con. Close;
    } catch (SQLException e) {}
    System.out.println ("Ex-Message:" + e.getMessage ());
    System.out.println ("ex-code:" + e.getErrorCode ());
    System.out.println ("Ex-SQLState:" + e.getSQLState ());
    System.out.println ("Ex-Next:" + e.getNextException ());
    e.printStackTrace ();
    System.GC();
    } catch (Exception e) {}
    System.out.println ("Exception caught:" + e);
    e.printStackTrace ();
    }
    }


    /**
    * Select CUST. MAT file.
    @param con The JDBC connection object.
    */
    public static void testQuery (connection con)
    throws SQLException
    {
    Statement stmt = con.createStatement ();
    String sql = "select DISTINCT LST.WO, no. PROD, BILL's LOCK. CARPET where LST.WO is not null or not. PROD is not zero. "
    Run the SELECT statement
    ResultSet rs = stmt.executeQuery (sql);

    Results of the first five records
    System.out.println ("\tlist selected columns for the first five records :");
    int i = 1;
    While (rs.next () & & I < 100)
    {


    System.out.println ("\tLST_WO: \t" + rs.getString (1));
    System.out.println ("\tNO_PROD: \t" + rs.getString (2));
    System.out.println ("\tLOCK: \t" + rs.getString (3));

    i ++ ;
    }

    RS. Close();
    stmt. Close();
    System.out.println ("\n\t*---QUERY test has been successfully-* \n");
    System.out.println ("\n\tDisplay Count: \t" + i);
    }

    }



    [root@VM-Linux01 Linux] # java billmat

    -Successful - connection

    1. select in the file Bill. MAT ------------------------
    LST_WO: null
    NO_PROD: null
    LOCK:
    LST_WO: null
    NO_PROD: 10
    LOCK:
    LST_WO: null
    NO_PROD: 15
    LOCK:
    LST_WO: null
    NO_PROD: 20
    LOCK:
    LST_WO: null
    NO_PROD: 6
    LOCK:
    LST_WO: null
    NO_PROD: 24
    LOCK:

    -QUERY test was performed with success-


    Number of view: 7


    The reason column THAT LOCK is included above is because he is using DG4ODBC queryable and presents itself as (null) in the result of the query and provided by SQLDeveloper.

    Considering the above findings, it seems what ORA-28528 IS NOT associated with problems of overflow or limits of length. Instead, some kind of mapping characterset problem here seems more plausible. For example, it seems NULL value returned in the case of the columns LST_WO and NO_PROD of the distant universe database is mapping not properly in the way that a NULL value is represented in the database 11 GR 2. Y at - it % HS_ in file init DG4ODBC value that can be set to solve this problem? I'm not quite sure the range of settings that exist, but try different values for HS_LANGUAGE which did not help.

    There is no problem using Excel MS Query to recover data using the same system DSN and associated ODBC driver on which DG4OBDC the installation program is based on the same Windows computer where DG4ODBC is configured.

    Here are the current settings of DG4ODBC for this instance (initDBLINK.ora):


    HS_FDS_CONNECT_INFO = DBLINK. ODBC
    HS_FDS_TRACE_LEVEL = WE
    HS_FDS_TRACE_FILE_NAME = c: / DG_LOG
    HS_FDS_TRACE_LEVEL = 4
    HS_LANGUAGE = AMERICAN_AMERICA. WE8ISO8859P1
    # Other parameters HS_LANGUAGE attempted to solve the problem are discussed below:
    # HS_LANGUAGE = american_america.utf8
    # HS_LANGUAGE = american_america.al32utf8


    Any guidance would be greatly appreciated!

    Edited by: WileyCoyote 8 March 2012 13:33

    Edited by: WileyCoyote 8 March 2012 13:39

    A gateway trace level 255 (HS_FDS_TRACE_LEVEL0 = 255) could be interesting - also the definition of the source table (how the table is defined in the database of version 10.1 IBM/Rockit universe).

  • Preview thumbnails on the page empty new tab only for some URLS

    When I open a new tab, there are three some preview thumbnails that are always empty, and there is no way I can make them appear again. They didn't work at first, but at some point the three extracts disappeared and never returned.
    I have already tried to empy cache and recharge sites as suggested here, but the thumbs are still empty. It's always the same three URLS where this happens. I have also erased from history, to open new sites and drag items in the history menu in a thumbnail - the same result.

    You can open the Web Console (Web Developer > Web Console;) CTRL + SHIFT + K) and click on the entrance to the home page (index) to inspect the response headers.

    You can reload webpages and ignore the cache to refresh all files.

    • Hold SHIFT and click reload.
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Cmd + Shift + R' (MAC)

    See also:

  • VI server activate remote control only for some controls

    Hi guys,.

    Is anyone know to allow control of only a few orders of façade when using web publishing tool? I have a few commands that I don't want not used remotely (it could be dangerous) and others I want to use remote.

    Thank you!
    Christopher


  • sharing is only working for some websites of Internet connection

    Wi - Fi my laptop is steady as a rock, but the wireless adapter I have for my office to cancel very often, so I decided to connect both via an ethernet cable and use internet connection sharing so that the Office can enjoy wireless laptop. Both computers have Windows 7 Home Premium installed.

    The Installer seems to work, but only for some Web sites - for example, it has no problem to connect to google and microsoft.com using ICS, but he absolutely refuses to connect to facebook but also many other Web sites. My laptop has no problem connecting to websites that my office cannot connect, so I'm puzzled as to why it seems to be able to relay connecting to some Web sites, but not others. Can someone help me understand what is happening here, so that I can access more than just pieces of the internet on my desktop?

    I'm sorry, but you can understand how annoying it can be when someone does not even time to read your question and posts nothing but completely irrelevant, canned solutions (who would would realize that they were not relevant if they had taken the time to read it instead of just copy - paste * based on the title of the post). It's worse than no help at all, because then people who might bring if not actually useful assistance will see oh, "this question has already been answered" and move to one that was not. In any case, I'll try to ask in this forum. Thanks for the suggestion.

  • Firefox "Remember password" only for specific accounts

    I have multiple gmail accounts and I want firefox to remember the password only for some of them. How do I do that?

    Whenever I log in with an account that firefox is not set to remember he asks me every time, and if I want to choose to not me to remember, I should never choose "remember passwords for this site", but I don't want that, since I have a few accounts that I want their password saved.

    Hello, you can simply click on "Never remember passwords for this site" - this will not affect your stored passwords currently for gmail but will not show the doorhanger to new passwords Panel...

  • RemoteScan is not for some users

    I recently installed RemoteScan on a new machine and got all this work in one programs installed on the RDS Server. In the other program requiring analysis, RemoteScan appears only for some users. I tried to recreate the user profile. I tried to copy it to the file remote.ini of a profile that works. I tried to reinstall RemoteScan on the workstation, but so far nothing has solved the problem. I have no idea what could be the cause and was hoping that someone could have encountered the same problem. Any help would be greatly appreciated.

    RemoteScan files must be in the user homepath. These files should be as follows:

    TWAIN_32 (folder... RemoteScan internal folder)
    TWAIN_32.dll 44KO
    Twunk_32.exe

    All these RemoteScan files should be in the folder windows homepath from the user. To confirm the homepath from the user, you need to connect to the server as the user and then display a command prompt. Type set home.

    If you have questions contact RemoteScan to 406-721-0276.

    Thank you

  • Where can I configure the rule of naming for the columns of the child?

    I have the logic model below:

    https://www.dropbox.com/s/1eux01rrkmcn84f/child_logical.PNG

    When I have the engineer I get the following physical model:

    https://www.dropbox.com/s/pwl2zxkvuigdr5q/child_physical.PNG

    How can I configure that no entity name prefix must be added to the name column?

    Columns must be named create_ts, modify_ts, delete_ts and attribute_1. (upcase all is ok).

    I tried to change the model of standard naming for attribute relationships, but it has no effect.

    Can someone give me a hint?

    I found a way to resolve names with a custom transformation script.

    ceving: abuse of inheritance for the coating with SQL Developer

    But the behavior of the new Modeler data seems to be different from the old. I create a model with the old. And now I'm still working on the model by the new. And for some columns, not the name of the inserted table and other tables. This occurs in the same model. I think that there still is some sort of bug in the problem.

  • No edit for OBIEE columns option is responding after upgrade.

    Hello

    We have updated the catalog from 10g to 11g. After that, for some columns we are witnessing not the option change/remove.

    Column group (by default: < TABLENAME >. < COLUMNNAME >).

    Now in RPD we changed the name of the column < COLUMNNAME 1 >. But we are not able to change them in the catalog. I tried with the seizure of the tab advanced and edited XML. But, no luck.

    Can anyone help


    Thank you
    Karim

    Hello

    May be the option "selector" column refer to this column. Just edit the column Chooser and then rename/remove the column of the selection.

    Note: If you want to rename this column name in the world just use the xml Manager catalog search and replace to rename.

    http://obiee1000.blogspot.SG/2012/06/XML-search-and-replace-useful-option.html

    Thank you
    Deva

    Published by: Devarasu on November 12, 2012 19:10

  • How to return a value empty for a column

    Hi all

    We want to create an abridged version of the BI dashboards report that has the same number and order of the columns, but fewer lines. This will improve the size and performance of the load, Services dashboard.

    For some columns, we need empty values, which means that the content must be empty, but the column must appear in the report.

    I tried a few options in the tab "format of the column" under properties of the column of check and played with 'column header' and 'value', however, I couldn't get the desired effect.

    Can achieve us?

    Please suggest me on the same.

    Regds
    Mano

    If you want to add a column to the State and the column indicates no data except null, you can do this by adding a column to the area in question and change its format to two single quotes without space between them (which basically means the null value).

  • ORA - 01461:can bind a LONG value only for insert in a LONG column. After upgrade to 11g

    After update, oracle 11g, we get the system error when you try to insert the text string in the NCLOB type column.

    ORA - 01461:can bind a LONG value only for insert in a LONG column.

    This has not happened on an earlier version of Oracle.

    I did some testing and found that, if a string more then 2000 we get this error.

    How to solve this problem?

    Thank you

    I found a solution. I had to update ODP.NET to 2.112.1.0 version.

  • Path for some characters only to compensate for

    Hello

    In a text written with the text tool, is it possible to offset the path for some characters only and not the entire text? FX menu is all gray when I select individual characters.

    This is for CS4.

    Thank you.

    What about using a script?

    like the Carlos those here

    Re: How to divide all managers of related one-character-by-textFrame?

  • Bind Peeking only for columns 'known '?

    Hi all

    We are working on our 11.2.0.3 database RAC (on AIX 7.1) to try to understand why a certain repeated (batch load) does not use the correct execution plan.

    The query itself looks like:

    Select the CATENTRY CATENTRY_ID where ((PARTNUMBER =: 1) GOLD ((0 =: 2) AND (PARTNUMBER IS NULL))) and ((MEMBER_ID =: 3) OR ((0 =: 4) AND (MEMBER_ID IS NULL)));

    This query is a query internal IBM Webshere, that is immutable.

    The table in question has an available on PARTNUMBER & MEMBER_ID index

    The execution plan looks like however

    The execution plan of the above statement looks like:

    Execution plan

    ----------------------------------------------------------

    0 SELECT optimizer Mode STATEMENT = ALL_ROWS (cost = 2038 card = 1 bytes = 23)

    1 0 TABLE ACCESS FULL WCSADMIN. CATENTRY (cost = 2038 card = 1 bytes = 23)

    Then a FTS scanning is used where expect an Index seek.

    The values passed to this application are for example:

    : 1 = XA-GOL-1068849

    : 2 = 1

    : 3 =-6000

    : 4 = 1

    With the part of the WHERE CLAUSE then having ((0=1) AND (PARTNUMBER IS NULL)) and ((0=1) and (MEMBER_ID IS NULL)) would be give rise to an Index seek.:

    Select

    catentry_id

    of catentry

    where ((partnumber = «XA-GED-5702810'))

    or ((0 = 1)

    "and (partnumber is null)))".

    and ((member_id = - 6000)

    or ((0 = 1)

    and (member_id is null)));

    Execution plan

    ----------------------------------------------------------

    0 SELECT optimizer Mode STATEMENT = ALL_ROWS (cost = 3 cards = 1 bytes = 23)

    1 TABLE ACCESS BY INDEX ROWID WCSADMIN 0. CATENTRY (cost = 3 cards = 1 bytes = 23)

    2 1 INDEX UNIQUE WCSADMIN SCAN. I0000064 (cost = 2 = 1 card)

    Somewhere in the analysis of the query optimizer does not have / use all of the information needed to determine the correct plan, although the trace file shows all the values are correctly captured

    I expect that the optimizer would be "PEEK" all the available variables to determine the best execution plan.

    It seems however that both binds to the "0 =: 2" and "0 =: 4"are not "read" and therefore not used, resulting in a full Table Scan as the PARTNUMBER IS NULL and MEMBER_ID IS NULL are not ignored. "

    Can someone confirm that binds only for columns ' existing/real' is to take a look?

    And is it configurable?

    Thank you

    FJ Franken

    It's an interesting question - at first glance, it seems that Adaptive cursor_sharing should be able to solve your problem.

    However, I think that the optimizer must produce a plan that will be THAT ALWAYS produces the correct result regardless of the actual values provided. Your application may require the optimizer to find rows where memberid and partnumber are null, and you index (probably) is not a required column in it then the only legal execution plan given that complete analysis.

    According to the relative frequency of values and the number of NULL values for each column, you may find that the generic solution (rather than the index only solution that you got for this specific request) is to create an index on (partnumber, member_id, 1) or (member_id, partnumber, 1) then the optimizer can use CONCATENATION to choose one of the two alternative ways.

    Concerning

    Jonathan Lewis

Maybe you are looking for

  • Blocked in Java and not click to playback option.

    Can someone please?I'm on FF 18, Windows XP and the latest Java (1.7.0_11).After spending many hours of research and reading messages on FF blocks Java I fully understand the reasoning for this and it's good for me BUT I don't want to view/use java o

  • Impossible to extend the AirPort Extreme wireless network

    I have a wireless network set up with a time Capsule airport 4th generation.  I'm trying to take my old AirPort Extreme wireless 3rd generation. I have double. Kettle has implemented, but I get the status message on the extreme that it cannot extend

  • right click on "Devices and Interfaces" does nothing

    Hey all,. I am trying to add a raw TCP VISA OR max socket.  When I right click on "Devices and Interfaces", the line is highlighted and any drop-down list appears, much like a left click.  However, when I right click on 'Software', the drop-down list

  • How to blur a part of the tree?

    I have a tree control with check marks and the option "text click on toggle mark. When I have a list of items that I have to disable (i.e. do grey) some of them, but I can't find the ATTR_DIMMED attribute for the SetTreeItemAttribute() function. I us

  • COMPAQ PRESARIO CQ57: COMPAQ CQ57 BIOS MASTER CODE

    MY COMPUTER IS LOCKED WITH BIOS PASSWORD ON POWER, THE STOP CODE IS 54506678 CAN SOMEONE PLEASE GIVE MASTER CODE TO GET IN? IT WOULD BE GREATLY APPRECIATED THANKS.