Other columns with group by

Hi,
Using oracle 10g on windows:
I want to get all the columns of scott.emp table group by deptno.
Because if i gives :
select * from emp group by detpno; then its gives me ORA-00979: not a GROUP BY expression
In addition to this please tell me how do i get if i wish to group by deptno,job.
Thanks in advance.

Yes, because i just want to get all the columns of any row of every dept numberGetting all rows doesn't mean you'll need a GROUP BY.
You'll need a GROUP BY when you want to aggregate values.
just want to fetch a single/any row group by deptno.I still think you want to use ORDER BY then:
SQL> -- 1. incorrect query
SQL> -- you cannot select * and use a group by
SQL> select *
  2  from   hr.employees e
  3  where rownum <= 10
  4  group by e.department_id
  5  ,        e.first_name;
select *
ERROR at line 1:
ORA-00979: not a GROUP BY expression
SQL>
SQL> --2. this doesn't order or group anything
SQL> select e.department_id 
  2  ,      e.first_name
  3  from   hr.employees e
  4  where rownum <= 10
  5  group by e.department_id
  6  ,        e.first_name;
DEPARTMENT_ID FIRST_NAME
           90 Steven
           60 Diana
           60 Alexander
           90 Lex
           60 Bruce
           60 Valli
          100 Nancy
           60 David
           90 Neena
          100 Daniel
10 rows selected.
SQL>
SQL> --3. using order by any column you want
SQL> --(here you can use select * as well, by the way)
SQL> select e.department_id 
  2  ,      e.first_name
  3  from   hr.employees e
  4  where rownum <= 10
  5  order by e.department_id
  6  ,        e.first_name;
DEPARTMENT_ID FIRST_NAME
           60 Alexander
           60 Bruce
           60 David
           60 Diana
           60 Valli
           90 Lex
           90 Neena
           90 Steven
          100 Daniel
          100 Nancy
10 rows selected.
SQL> [Group by|http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2182483]
[Order by|http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2171079]

Similar Messages

  • How do I open a folder on my desktop and avoid getting the left hand column with devices shared, etc and the other column with my desktop lists?

    I just want to see the contents of the folder not all the other columns!

    Finder->View-Hide Sidebar (⌘⌥ S). Once set, ⌘J and select Use as Defaults. That'll ensure all newly opened windows have that setting.

  • Dynamic columns with grouping.... in crystal report...using java /c# api ??

    I need to create a report with dynamic columns
    for e.g/
                                           Pre   Scen 1   Scen 2   Scen 3   Scen 4   Scen 5   Scen 6      .....
    *Total                          4.5118   4.5118    4.5118   4.5118   4.5118        4.5118   4.5118     *
    *Canada                    1.7180    1.7180    1.7180   1.7180  1.4103     8.4103      8.4103     *
       BG                           1.6224    0.9641    1.0473   1.0473  6.4635     6.4635  1.6224     
       BI                              0.044     0.0827     0.3578   0.3578 0.0560     0.0560   0.0744     
      DIN                    0.0056     -0.0655     -0.0215     -0.0215     -0.0210     -0.0210     0.0056     
    *Czech Republic     1.7180     1.7180     1.7180     1.7180     18.4103     18.4103     18.4103     *
      CEE               0.0275     1.0000     0.7359     100.0000     0.0858     0.0858     0.0275     
    *Israel               1.7180     1.7180     1.7180     1.7180     18.4103     18.4103     18.4103     *
      F                    0.0077     1.0000     0.7359     100.0000     -0.0035     -0.0035     0.0077     
    *United States          1.7180     1.7180     1.7180     1.7180     18.4103     18.4103     18.4103     *
      A                    0.0144     0.1871     91.0473     0.0679     0.0544     0.0544     0.0144     
      AA                    0.0428     0.0626     0.3578     0.0675     0.1175     0.1175     0.0428     
      AB                    0.0431     0.1553     -0.0215     0.1685     0.1199     0.1199     0.0431     
    in this report....grouping will be parameterized ....and total also required at every stage...
    so how can i add the columns dynamically ?
    number of columns are not fixed...they may be 20...30....etc

    Requirement is...
    I have a table scn ... where i can make entries any time....assume they are some rules...
    I have another table called t1 ... where i need to calculate values of t1 again some specific rules are table scn.
    So for each t1 there will be one row with columns as scn entries which I select on interface.
             Original Value  --  Sc1 ......  Sc2  ...... Sc3  ......  Sc4 ......  Sc5 . . . . . .. .
    t1...................xx...... xx..........xx..........xx........ xx........ xx
    t3...... .............xx...... xx..........xx..........xx........ xx........ xx
    t4....................xx...... xx..........xx..........xx........ xx........ xx
    selection of these scn columns will be dynamic....so i cant create n number of columns in the report template and hide them as per requirement....it will not work.
    Wat is a feasible solution to create such kind of report ?
    Can we create template in C# or .net ?
    IF yes...do we have to save every time in order to render report ?
    e.g.   one report may contain 4 columns and other 10 ... so do i have to create new rpt file each in order to render the report ?
    Please if any1 have approach to create this kind of report then it will very helpful....
    Edited by: pchawan on Jul 19, 2011 11:28 PM

  • I am unable to insert the sql data into sharepoint column(with type "Person or Group") through SSIS package.

     can anyone suggest me how to insert values to sharepoint list column of datatype (person/group datatype).  Also, Does sharepoint list allows nulls as a value?
    please help.
    Thanks
    Raghavendra

    Hi Raghavendra,
    Based on my test, if we directly insert a column with people account or group name with domain\user or domain\group formats to a SharePoint list, those columns with the values would be ignored when executing the package. Other columns with Null value would
    be insert into the list. If we insert a column with numeric format, the values would change to corresponding user or group based on the site permissions in SharePoint site.
    So to fix this issue, I suggest we can select <ignore> maps to the “People or Group” column in SharePoint list. The “People or Group” column would show null value in SharePoint list. Then we can manually or use workflow feature add values in the “People
    or Group” column in SharePoint list.
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Export Users data with group membership

    Hey Guys,
    I'm using csvde to export users data for management reports.
    I'm asked to add to the exported data the group membership of the users and I'm having problem doing that.
    My current script is:
    csvde.exe -s 192.168.xx.xx -d "ou=CS,dc=Domain,dc=com" -r objectClass=user -l "Company,DisplayName,sAMAccountName,title,lastlogon,pwdLastSet" -f c:\usersonly-Users.csv
    Can anyone help me adding column with groups the user is member of?
    Thanks
    Nir 

    Add the memberOf attribute to the list of attribute values to retrieve.
    Richard Mueller - MVP Directory Services

  • Column with header data value

    Hi All.
    I have a control file which i need to add a column with header data value.
    example
    data file:
    123456;201303
    santiago;producto1;100
    santiago;producto2;200
    valparais;producto1;400
    valparais;producto3;900
    The control file skip the first column and load the three columns on the table, but, now i need to add other column with 201303 value constant of the first record and load it on the table.
    Then
    select * from table:
    santiago producto1 100 201303
    santiago producto2 200 201303
    valparais producto1 400 201303
    valparais producto3 900 201303
    How i do this in the control file?
    Regards!

    SCOTT@orcl_11gR2> host type test.dat
    123456;201303
    santiago;producto1;100
    santiago;producto2;200
    valparais;producto1;400
    valparais;producto3;900
    SCOTT@orcl_11gR2> host type test1.ctl
    options (load=1)
    load data
    infile test.dat
    replace
    into table onecol_onerow
    fields terminated by ';'
    trailing nullcols
    (filler1 filler, newcol)
    SCOTT@orcl_11gR2> host type test2.ctl
    options (skip=1)
    load data
    infile test.dat
    append
    into table test_tab
    fields terminated by ';'
    trailing nullcols
    (col1, col2, col3,
    newcol expression "(select newcol from onecol_onerow)")
    SCOTT@orcl_11gR2> create table onecol_onerow
      2    (newcol number)
      3  /
    Table created.
    SCOTT@orcl_11gR2> create table test_tab
      2    (col1   varchar2(15),
      3     col2   varchar2(15),
      4     col3   number,
      5     newcol number)
      6  /
    Table created.
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test1.ctl log=test1.log
    SQL*Loader: Release 11.2.0.1.0 - Production on Mon May 6 10:46:44 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 1
    SCOTT@orcl_11gR2> select * from onecol_onerow
      2  /
        NEWCOL
        201303
    1 row selected.
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test2.ctl log=test2.log
    SQL*Loader: Release 11.2.0.1.0 - Production on Mon May 6 10:46:45 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 4
    SCOTT@orcl_11gR2> select * from test_tab
      2  /
    COL1            COL2                  COL3     NEWCOL
    santiago        producto1              100     201303
    santiago        producto2              200     201303
    valparais       producto1              400     201303
    valparais       producto3              900     201303
    4 rows selected.

  • Matrix exporting to excel with empty columns, with page break option of "Between each instance of a group" selected.

    I am working with Report Builder 3.0 I am using a matrix to produce grouped data on separate worksheets in excel.
    The select is:
    SELECT ID, Measurement, Value, [Date] FROM Measurements_Report. (please ignore the underscores they are just for formatting) 
    The contents of the Measurements_Report table:
    ID__Measurement__Value__[Date]
    1___Hot_________33_____10/1/2014
    2___Hot_________44_____10/2/2014
    3___Cold_________55_____10/2/2014
    The matrix contains a single row group based on the field "measurement". The Measurement group has the page break option of "Between each instance of a group" selected. 
    There is a column group based on the field "Date". 
    When this is matrix is exported to excel on the first worksheet (Hot) there are three columns as shown below:
    ID__10/1/2014____10/2/2014___10/2/1014
    1___33
    2_______________44
    Notice the last column doesn't have a value.
    On the second worksheet (Cold) there are also three columns as shown below:
    ID__10/1/2014___10/2/2014___10/2/1014
    3__________________________55
    This time notice there is only one row and only a value in the last column.
    I only want the columns with data for that worksheet to show up. How can I remove these empty/duplicate columns? Hopefully there is a simple fix. Thanks ahead of time.

    With the following contents of the Measurements_Report table:
    ID__Measurement__Value__[Date]
    1___Hot_________33______10/1/2014
    2___Hot_________43______10/1/2014
    2___Hot_________44______10/2/2014
    3___Cold________55______10/2/2014
    Returns on the first tab (Hot):
    ID__10/1/2014____10/1/2014____10/2/2014
    1___33
    2_________________43
    2______________________________44
    In the excel worksheet it contains a separate column for each date with a value. Thanks again!
    Why is the same date repeating on multiple columns? Do you've the time part also returned from database?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to order an entire Report by a column with in a group...

    Okay, I have a Group Above report, and I want to order the groupings by a column within the group. I am using a lexical parameter in place of the entire ORDER BY statement in the query, giving the user the capability to sort the report by any specific column, at runtime.
    So, basically, this parameter allows for the ORDER BY to be dynamic; however, in the Data Model, I am required to designate at least one hard-coded break column, which overrides whatever column is designated by the user at runtime.
    Any ideas how I can get around this?

    Hi Brice,
    If you want just i single hard coded column in a group
    then i think you can create summary column with counting
    so you can say say a column that gives you just Serial no.
    and rest of the thing as it is.
    in this way you got your hard column and also Order by facility
    that you want.
    Hope that helps you.
    Enjoy Oracle....

  • How to update person or group column with peopleeditor control values

    Hi,
    I have created custom aspx page and added "PeopleEditor" control(can select multiple users)  in that page. Now I am trying to update person or group column with peopleeditor control values.I am not getting any error if I select single user
    in PeopleEditor control but getting error if I select more than one user.
    UpdateItem(listItem, "ListColumnName",
    listItem.ParentList.ParentWeb.EnsureUser(peopleeditorId.CommaSeparatedAccounts));
    Can anybody help me out to resolve the issue?
    Thank you in advance!!!
    AA.

    First get all the users/groups from the PeapleEditor by using PeapleEditor.ResolvedEntities
    foreach (PickerEntity pickerEntity in peopleEditor.ResolvedEntities)
    SPPrincipalType principalType = (SPPrincipalType)Enum.Parse(typeof(SPPrincipalType), pickerEntity.EntityData["PrincipalType"].ToString());
    if (principalType == SPPrincipalType.User || principalType == SPPrincipalType.SecurityGroup)
    string loginName = pickerEntity.Key;
    //your code here
    else if (principalType == SPPrincipalType.SharePointGroup)
    string groupName = pickerEntity.Key;
    //your code here
    Add all the users/groups in an instance of SPFieldUserValueCollection
    and then update your list item.
    SPFieldUserValueCollection users = new SPFieldUserValueCollection();
    users.Add(new SPFieldUserValue(web,user.ID,user.Name));
    item["YourUserColumn"] = users;
    item.Update();

  • Document library view: Group by a column with multiple values

    I have a document library which has a managed metadata column.
    I would like to create a view which groups the documents by this managed metadata column.
    The managed metadata column can have multiple values.
    I know that this is not possible with SharePoint's group by, since it only accepts those columns which can have only one single value.
    But is this possible to accomplish by some other means, e.g. Content query web part? Or is there perhaps a 3rd party solution to this?
    Is it possible to change the group by settings somehow to allow Group by to function with columns with multiple values? <- this may be far fetched...

    Hi Pekch,
    I'm assuming you have VS2010 to build the custom web part. From there you will need to figure out the following:
    Get a SPList object for the Document Library (See below for code example)
    Loop through all the documents in the SPList object 
    If you have audience targetting enabled, then you'll need to determine if the user has access to the document by checking the "Target_x0020_Audiences" column)
    As you also want to group by metadata, you'll need to populate 2 datatables (one table with a column containing unique metadata values and another table with a metadata column and other document related columns).  Link these two tables via a dataset
    relation.
    Set the dataset as the datasource for a repeater, add in some css and javascript for the group expand/collaspe and it should be close to what you need.
    This will be a time consuming task if you don't know where to start or have problems figuring out how to perform a certain operation.  So you may want to determine if the functionality you want is required or just a "nice to have".  Good
    luck and if I have some spare time, I'll create a blog post outlining how to do all the above.
    I got the below code from a sharepoint blog sometime in the past and you can use it to retrieve a list.
    You can use it like this: GetListByUrl(http://servername/Shared%20Documents/Forms/AllItems.aspx)
    using    Microsoft.SharePoint;
    public SPList GetListByUrl(string listURL)
    SPList list = null;
    try
    using (SPSite site = new SPSite(listURL))
    if (site != null)
    // Strip off the site url, leaving the rest
    // We'll use this to open the web
    string webUrl = listURL.Substring(site.Url.Length);
    // Strip off anything after /forms/
    int formsPos = webUrl.IndexOf("/forms/", 0, StringComparison.InvariantCultureIgnoreCase);
    if (formsPos >= 0)
    webUrl = webUrl.Substring(0, webUrl.LastIndexOf('/', formsPos));
    // Strip off anything after /lists/
    int listPos = webUrl.IndexOf("/lists/", 0, StringComparison.InvariantCultureIgnoreCase);
    if (listPos >= 0)
    // Must be a custom list
    // Strip off anything after /lists/
    webUrl = webUrl.Substring(0, webUrl.LastIndexOf('/', listPos));
    else
    // No lists, must be a document library.
    // Strip off the document library name
    webUrl = webUrl.Substring(0, webUrl.LastIndexOf('/'));
    // Get the web site
    using (SPWeb web = site.OpenWeb(webUrl))
    if (web != null)
    // Initialize the web (avoids COM exceptions)
    string title = web.Title;
    // Strip off the relative list Url
    // Form the full path to the list
    //string relativelistURL = listURL.Substring(web.Url.Length);
    //string url = SPUrlUtility.CombineUrl(web.Url, relativelistURL);
    // Get the list
    list = web.GetList(listURL);
    catch { }
    return list;

  • How to do a count on one column with a group by on another column

    Hello there
    I have one report that I need to generate. On that report there are several measure columns. Column A is number of calls, column B is type of calls.. Now I need a new column which is column C, and C need to be a count (A) group by B..
    I know how to do that in OBIEE, but how would I be able to do that in BIP template builder? I can use calculation function "count" on column C, but how would i defined it is grouped by column B?
    Please help
    Thanks

    Let's say a given XML structure is as following
    *<?xml version="1.0" encoding="UTF-8" ?>*
    - <-Quote>
    - <service>
    *<account>ATAHU</account>*
    *<ContractedProductsOnlyFlag>N</ContractedProductsOnlyFlag>*
    *<accountId>BMP8</accountId>*
    *<accountType>Customer</accountType>*
    *</service>*
    - <service>
    *<account>ATAHU</account>*
    *<ContractedProductsOnlyFlag>Y</ContractedProductsOnlyFlag>*
    *<accountId>BMP8</accountId>*
    *<accountType>business</accountType>*
    - <service>
    *<account>Booot</account>*
    *<ContractedProductsOnlyFlag>Y</ContractedProductsOnlyFlag>*
    *<accountId>BMP8</accountId>*
    *<accountType>Customer</accountType>*
    *</service>*
    - <service>
    *<account>Booot</account>*
    *<ContractedProductsOnlyFlag>Y</ContractedProductsOnlyFlag>*
    *<accountId>BMP8</accountId>*
    *<accountType>Household</accountType>*
    *</service>*
    - <service>
    *<account>ATAHU</account>*
    *<ContractedProductsOnlyFlag>N</ContractedProductsOnlyFlag>*
    *<accountId>B-type</accountId>*
    *<accountType>Customer</accountType>*
    *</service>*
    *</service>*
    *</-Quote>*
    How would I be able to count "account" and group by "account" in a new column so for:
    Account Flag ACCOUNT ID Type
    ATAHU N BMP8 Customer
    ATAHU Y BMP8 BUSINESS
    BOOOT Y BMP8 CUSTOMER
    BOOOT Y BMP8 HOUSEHOLD
    ATAHU N B-TYPE CUSTOMER
    In the RTF template It will become:
    Account ACCOUNT count other columns
    ATAHU 3
    BOOOT 2
    Please advice
    Edited by: user7276913 on Sep 16, 2009 12:47 AM

  • Need to update a single column in a table with some other column value

    Hi experts,
    I was about to change one column data type in a table. Then I renamed that column name to "old_column_name" . Later I added new column name with required datatype( My case its NCLOB). Now I want to update the new column value with old column value.I mean i have to copy the data. But data amount is very huge. Its more than 1.5 crores of data. But on promote day, I have only 1 hr of outage. Please suggest the effective solution to achieve this.

    Hi Stew
    I have 1 primary key in my table and 11 foreign keys in my table.there are 20 check constraints as well.
    If i go for an online redefine of a table, these objects will be created back automatically?
    Please clarify.
    This is my table. Here Remarks is the column with CLOB datatype. To support multi language, I need to change it to NCLOB. That column having data so i cant rename it.
    So I added new column , after renaming that remarks to old_remarks. Now new column remarks is ready with NCLOB data type, but no data in it.
    To copy the old remarks column into new remarks column, i thought to write one script. But how it is achievable using "DBMS_REDEFINITION". Please explain me,
    create table XXXXXXXXXX
    ID NUMBER(8),
    COMPLETED_DATE DATE,
    COMMUNICATION_MEDIUM VARCHAR2(32),
    REMARKS1 VARCHAR2(4000),
    COPY VARCHAR2(1),
    IO_MARKER VARCHAR2(3),
    EVENT_DATE DATE,
    CON_REF_NO NUMBER(8),
    DEP_CODE VARCHAR2(6),
    SFM_STAFF_NO NUMBER(8),
    CRPD_ID NUMBER(8),
    CRPD_ID_COPY NUMBER(8),
    STATUS VARCHAR2(2),
    COMEBACK_NO NUMBER(2),
    ADD_ADD_ID NUMBER(10),
    AEV_ID NUMBER(8),
    OLAY_ID NUMBER(8),
    COE_TYPE VARCHAR2(3),
    CET_CODE VARCHAR2(6),
    DEP_CODE_RAISED_BY VARCHAR2(6),
    SFM_STAFF_NO_RAISED_BY NUMBER(8),
    USR_CREATED VARCHAR2(30),
    CREATED DATE,
    USR_CHANGED VARCHAR2(30),
    CHANGED DATE,
    EXT_REF_ID VARCHAR2(150),
    REPLY_EXPECTED_DATE DATE,
    SEC_ID VARCHAR2(8) not null,
    PROTECTED VARCHAR2(1),
    APPROVED_BY NUMBER(8),
    DOCUMENT BLOB,
    OLD_REMARKS CLOB,
    CTS_ID NUMBER(8),
    MESSAGE_STATUS VARCHAR2(4),
    WORD_DOCUMENT NCLOB,
    REMARKS NCLOB
    Edited by: Hema on Jul 2, 2012 8:31 AM
    Edited by: Hema on Jul 2, 2012 8:31 AM

  • How can i select other column values('-' separated) in group by function

    CREATE TABLE EMP (
         EMPNO NUMBER(4) NOT NULL,
         ENAME VARCHAR2(10),
         JOB VARCHAR2(9),
         SAL NUMBER(7)
    INSERT INTO EMP(EMPNO, ENAME, JOB, SAL) VALUES (7369, 'SMITH', 'CLERK', 800);
    INSERT INTO EMP(EMPNO, ENAME, JOB, SAL) VALUES (7499, 'SMITH', 'SALESMAN', 1600);
    INSERT INTO EMP(EMPNO, ENAME, JOB, SAL) VALUES (7521, 'ALLEN', 'SALESMAN', 2400);
    In Output I want 3 columns : EMP,SUM(SAL),JOB(hyphenSeparated)
    Means i want my output like
    First row : SMITH,2400,CLERK-SALESMAN
    Second row : ALLEN,2400,SALESMAN
    I tried to write following sql : select ename,sum(sal) from emp group by ename
    But i want other colummn value in '-' separated. but group by is only allowing agreegated function.
    How can i select other column value using group by function.

    SQL>  select ename,sum(sal), listagg(job, '-') within group (order by job) as job  from emp group by ename;
    ENAME        SUM(SAL) JOB
    ALLEN            2400 SALESMAN
    SMITH            2400 CLERK-SALESMANnote: LISTAGG is a feature of 11.2

  • Select multiple columns from tab with group by

    hi
    i have a table with many columns suppose in that i have 2 columns as date and time
    and in my table i am getting suppose data like
    columns -> date time a b c
    22-may-2207 10
    22-may-2207 17
    23-may-2007 5
    24-may-2007 12
    24-may-2007 15
    i want to select all columns with data with unique data with max of time for that particular date
    answer :-
    22-may-2007 17 a b c
    23-may-2007 5 a b c
    24-may-2007 15 a b c
    with all other cloumns also with this
    plz help me i am trying too much and not able to solve this.

    try this
    select datecol, timecol, a, b, c
    from (
    select datecol, timecol, a, b, c,
            rank() over(partition by datecol order by timecol desc) rn
    from my_table
    where rn = 1
    order by datecol;Message was edited by:
    Jens Petersen

  • Update other items with the same value when when column contains Y

    CREATE TABLE TEST
       (     "QUATINTY" NUMBER(17,2),
         "AMOUNT" NUMBER(17,2),
         "ERRORRED" VARCHAR2(16 BYTE),
         "PO" VARCHAR2(12 BYTE),
         "LINE" VARCHAR2(10 BYTE),
         "SEQ" VARCHAR2(14 BYTE),
         "INVOICE" VARCHAR2(16 BYTE)
    Insert into TEST (PO,QUATINTY,AMOUNT,ERRORRED,LINE,SEQ,INVOICE) values ('123',5,50,'Y','1','1','inv1');
    Insert into TEST (PO,QUATINTY,AMOUNT,ERRORRED,LINE,SEQ,INVOICE) values ('123',5,50,null,'1','2','inv1');
    Insert into TEST (PO,QUATINTY,AMOUNT,ERRORRED,LINE,SEQ,INVOICE) values ('125',5,50,null,'1','1','inv2');
    Insert into TEST (PO,QUATINTY,AMOUNT,ERRORRED,LINE,SEQ,INVOICE) values ('125',4,50,null,'1','2','inv2');If you notice by the table above what im trying to acomplish is update the errorred column with 'Y' if any of the po and invoice are the same and have a 'Y' on the errored column.
    in other words, i should end up with 'Y' in the errorred column for INV1.
    Can someone point me in the right direction i cant for the life of me figuered this one out.

    Hi,
    Here's one way:
    UPDATE     test
    SET     errorred     = 'Y'
    WHERE     NVL (errorred, 'N') != 'Y'
    AND     (po, invoice)          IN (
                              SELECT  po, invoice
                         FROM      test
                         WHERE      errorred  = 'Y'
    ;This assumes that po and invoice are not NULL. If either column can be NULL, then the solution might be a little messier, depending on the results you want, but only a little. Post some sample data (with NULLs) that shows what kinds of situations you need to handle, and the results from that sample data.

Maybe you are looking for

  • Full screen gaming

    For some reason when I am playing games in fullscreen mode a random frame rate drop will occur. A typical scenario from world of warcraft is as follows. I am in a zone of the game levelling where the graphics are not too demanding. I am getting a smo

  • Need Help: Adobe Acrobat Pro 9 Slow Performance on MacPro

    We installed Adobe Acrobat pro as part of Design premium on MACPRO twelve Core 2.93 with 10GB Memory and 27inch Display running OS 10.8.4 We opened high resolution pdf file 170MB with 330pages with 300% Zoom, when we scrolled trough the pages, the re

  • Mac Office 2004

    I have run Mac Office fine for several months now. Then the other day when I tried to open Word I got this error: Application Launch Failure The application Word couldn't be launched because of a shared library error "< Microsoft Word > <Microsoft Wo

  • DPM 2012 R2 (ID 104 Details: Internal error code: 0x809909FF)

    We are running DPM 2012 R2 on Windows Server 2012 R2 We have a Protection Group:Servers (9 members) where 5 servers always give the same error message, when we try to run a synchronization job with consistency check. With other 4 server everything is

  • WISM at headquarters and 1121G's at WAN sites (T-1)

    I have approximatley 100 1121G aps that were autonomous and coverted to lightweight on my LAN with various wlans. I have 13 WAN sites that are connected T-1 with about 20 1121G's currently in autonomous mode. Can I convert those aps to lightweight an