NEED SQL QUERY writing help

oracle 10g.
os : linux
table data appears like this
SQL> select * from test_grp;
COL1 COL2
aaa 111
aaa 444
aaa 222
bbb 333
bbb 555
SQL> select * from test_grp order by 2;
COL1 COL2
aaa 111
aaa 222
bbb 333
aaa 444
bbb 555
As per my application requirement I need to seggerage the data as
follows
aaa (2) ie --- 111,222
bbb(1) is --- 333
aaa(1) is --- 444
bbb(1) is -- 555
I am not able to frame this. Any help ?

SQL> create table test_grp
  2  as
  3  select 'aaa' col1, 111 col2 from dual union all
  4  select 'aaa', 444 from dual union all
  5  select 'aaa', 222 from dual union all
  6  select 'bbb', 333 from dual union all
  7  select 'bbb', 555 from dual
  8  /
Tabel is aangemaakt.
SQL> select col1
  2       , col2s
  3    from ( select col1
  4                , rtrim(col2s,',') col2s
  5                , rn
  6                , sumn
  7             from ( select col1
  8                         , col2
  9                         , sum(n) over (order by col2) sumn
10                      from ( select col1
11                                  , col2
12                                  , case when col1 = lag(col1) over (order by col2) then 0 else 1 end n
13                               from test_grp
14                           ) t
15                  )
16            model
17                  partition by (sumn)
18                  dimension by (row_number() over (partition by sumn order by col2) rn)
19                  measures (col1, cast(col2 as varchar2(100)) col2s)
20                  rules
21                  ( col2s[any] order by rn desc = col2s[cv()] || ',' || col2s[cv()+1]
22                  )
23         )
24   where rn = 1
25   order by sumn
26  /
COL COL2S
aaa 111,222
bbb 333
aaa 444
bbb 555
4 rijen zijn geselecteerd.Regards,
Rob.

Similar Messages

  • I need sql query please help me out

    I have two databases 1) erp 2) edusource
    In erp database i  have table  master tables and  columns  like RecordId , value type ,Feildtext,description,Meaining,parentid etc
     data stores based on value type like
    1
    Country
    In
    India
    NULL
        NULL
    True
    2
    Country
    Aus
    Austrilia
    NULL
        NULL
    True
    3
    Country
    Usa
    United States of America
    NULL
        NULL
    True
    4
    Country
    Uk
    Great Britian
    NULL
        NULL
    True
    5
    State
    AP
    Andhrapradesh
    NULL
         1
    True
    6
    State
    MH
    Maharastha
    NULL
         1
    True
    7
    State
    TN
    Tamilnadu
    NULL
         1
    True
    8
    State
    Sdy
    Sydney
    NULL
         2
    True
    9
    State
    MEL
    Melbourne
    NULL
    2
    True
    10
    Location
    IN-Hyd
    Hyderabad
    NULL
    1
    True
    11
    Location
    In SEz
    Sez-Hyderabad
    NULL
    1
    True
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    for  country and state we have a relation ship parentid and recordid
    country
    1 Country
    In India
                                       NULL
    NULL 1
    2 Country
    Aus Austrilia
                               NULL
    NULL 1
    3 Country
    Usa United States of America    NULL
    NULL 1
    4 Country
    Uk Great Britian
                    NULL
    NUL          1 
    5 State
    AndhraPradesh Ap
    NULL 1
    1
    6 State
    Maharastha MH
    NULL 1
    1
    7 State
    Tamilnadu        TN
    NULL        1
    1
    8 State
    Sydney            Sdy   NULL
          2 1
    9 State        Melbourne       MEL
    NULL       2
    1
      in edusource  database i have location and columns like countryname,statename,feildtext,descriptiom,isactive
    i need to insert data in edusource
     database of tbl_ maplocation from that that database

    Try this out:
    DECLARE @geog TABLE (ID INT, type VARCHAR(20), Abrev VARCHAR(6), name VARCHAR(30), parentID INT, Active VARCHAR(5))
    INSERT INTO @geog (ID, type, Abrev, name, parentID, Active) VALUES
    (1 , 'Country' ,'In ', 'India ', NULL, 'TRUE'),(2 , 'Country' ,'Aus ', 'Austrilia ', NULL, 'TRUE'),
    (3 , 'Country' ,'Usa ', 'United States of America', NULL, 'TRUE'),(4 , 'Country' ,'Uk ', 'Great Britian ', NULL, 'TRUE'),
    (5 , 'State' ,'AP ', 'Andhrapradesh ', 1 , 'TRUE'),(6 , 'State' ,'MH ', 'Maharastha ', 1 , 'TRUE'),
    (7 , 'State' ,'TN ', 'Tamilnadu ', 1 , 'TRUE'),(8 , 'State' ,'Sdy ', 'Sydney ', 2 , 'TRUE'),
    (9 , 'State' ,'MEL ', 'Melbourne ', 2 , 'TRUE'),(10 , 'Location' ,'IN-Hyd', 'Hyderabad ', 1 , 'TRUE'),
    (11 , 'Location' ,'In SEz', 'Sez-Hyderabad ', 1 , 'TRUE')
    SELECT g1.ID, COALESCE(g2.name,g1.name) AS countryName, g1.name AS stateName, g1.name AS fieldText, CASE WHEN COALESCE(g2.Active,'TRUE') = 'TRUE' AND g1.Active = 'TRUE' THEN 'TRUE' ELSE 'FALSE' END AS Active
    FROM @geog g1
    LEFT OUTER JOIN @geog g2
    ON g1.parentID = g2.ID
    AND g1.type IN ('location','state')
    WHERE g1.Active = 'TRUE'
    AND COALESCE(g2.Active,'TRUE') = 'TRUE'
    I think you may want to further the relationship, and have 10 be the parent for 11, so you can get country, state, location.

  • Need Sql Query that Suppress the repeating rows.

    Hi Sir,
    I have below data set.
    DeptID  Sum(SAL) Avg(Sal)
      10      1300      1300
      10      2450      1300
      10      5000      1300
      20      800        800
      20      1100      800
      20      2975      800
      20      3000      800
      30      800        800
      30      1100      800
      30      2975      800
      40      3000      800
      40      4000      900
    I Need  SQL query that can remove the duplicate or suppress.Just like below data set.
    Output:
    DeptID  Sum(SAL) Avg(Sal)
      10      1300      1300
                2450      1300
                5000      1300
      20       800        800
                1100      800
                2975      800
                3000      800
                800        800
      30      1100      800
                2975      800
      40      3000      800
               4000      900
    Could you please help me on this..

    Your requiremnt is more of a reporting request which should not be handled in SQL. For example in SQL Plus you can use the BREAK command
    SQL> break on deptno
    SQL> select deptno, ename from emp order by deptno;
        DEPTNO ENAME
            10 KING
               CLARK
            20 JONES
               SCOTT
               SMITH
               ADAMS
            30 TURNER
               MARTIN
               WARD
               ALLEN
               BLAKE
    11 rows selected.
    SQL>
    But if you still wish to do it in SQL you can use ROW_NUMBER analytic function and achieve it like this
    select decode(rno, 1, deptno) deptno
         , ename
      from (
              select row_number() over(partition by deptno order by ename) rno
                   , deptno
                   , ename
                from emp

  • Need sql query to import from excel sheet

    Hey , i need sql query to import from excel sheet.
    i work in a company where i need to daily update the data from excel sheet.
    if i get a shortcut method i ill be very thank full to you guys to reduce my work upto 10 %.

    any query which can inert from excel file?
    Sort of. Certainly not anything as simple as what you seem to hope for. Check out this very good PHP class:
    PHPExcel - Home

  • Sql query writing best practises

    HI forum,
    Any body is having a tutorial on sql query writing best practises...pls share with me
    Thanks

    For example:
    [url http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/toc.htm]Oracle Database Performance Tuning Guide 10g Release 2 (10.2)
    [url http://people.aapt.net.au/roxsco/tuning/]Oracle SQL Tuning Guide
    Gints Plivna
    http://www.gplivna.eu

  • Cluster bar chart- sql query please help-

    Hi,
    I am trying to create cluster bar chart and am stumped with this sql query.Any help is appreciated.
    Here is my table
    city     region      issue     value
    c1     north     i1     y
    c1     north     i2     y
    c2     north     i1     n
    c2     north     i2     y
    c3     south     i1     y
    c3     south     i2     n
    c4     east     i1     n
    c4     east     i2     n
    The bar chart will have 3 series, north south and east.
    And labels will be i1 and i2. value will be number of times this issue was encountered(y) in this region.
    How can I get something like this from the above table-
    region     issue     count(yes)
    north     i1     1
    north     i2     2
    south     i1     1
    south     i2     0
    east     i1     0
    east     i2     0
    thanks

    WITH table1 AS
    (SELECT 1435177 qte_id, 2 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 5 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 7 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 8 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 12 seq_no
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 14 seq_no
    FROM dual
    table2 AS
    SELECT 1435177 qte_id, 1 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 2 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 3 seq_no, 0 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 4 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 5 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 7 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 8 seq_no, 98500 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 11 seq_no, 59300 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 12 seq_no, 59300 cmmt_curr_amt
    FROM dual
    UNION ALL
    SELECT 1435177 qte_id, 14 seq_no, 59300 cmmt_curr_amt
    FROM dual
    SELECT qte_id, t2_seq_no, cmmt_curr_amt - cmmt_curr_lag diff
    FROM
    (SELECT t2.qte_id, t2.seq_no t2_seq_no, t1.seq_no t1_seq_no, cmmt_curr_amt, LAG(cmmt_curr_amt,1,0) OVER (PARTITION BY t2.qte_id ORDER BY t2.seq_no) cmmt_curr_lag
    FROM table1 t1, table2 t2
    WHERE t2.qte_id = t1.qte_id (+)
    AND t2.seq_no = t1.seq_no(+)
    ORDER BY 1,2
    WHERE t1_seq_no IS NOT NULL
    ORDER BY 1,2
    QTE_ID T2_SEQ_NO DIFF
    1435177 2 0
    1435177 5 0
    1435177 7 0
    1435177 8 0
    1435177 12 0
    1435177 14 0

  • Need sql query to remove duplicates using UNION ALL clause

    Hi,
    I have a sql query which has UNION clause.But the UNION clause is causing some performance issues.
    To overcome that I have used UNION ALL to improve performance but its returning duplicates.
    Kindly anyone send a sample SQL query where my primary objective is used to use UNION ALL clause and to consider unique rows (elimating duplicate
    ones)
    Any help will be needful for me
    Thanks and Regards

    why not UNION? :(
    another way also use MINUS
    SQL>
    SQL> with t as
      2  (
      3  select 1 if from dual union all
      4  select 2 if from dual union all
      5  select 1 if from dual union all
      6  select 3 if from dual union all
      7  select 3 if from dual
      8  )
      9  ,t2 as
    10  (
    11  select 1 if from dual union all
    12  select 2 if from dual union all
    13  select 3 if from dual union all
    14  select 4 if from dual union all
    15  select 5 if from dual
    16  )
    17  (select if from t
    18  union all
    19  select if from t2)
    20  /
            IF
             1
             2
             1
             3
             3
             1
             2
             3
             4
             5
    10 rows selected
    SQL> so
    SQL>
    SQL> with t as
      2  (
      3  select 1 if from dual union all
      4  select 2 if from dual union all
      5  select 1 if from dual union all
      6  select 3 if from dual union all
      7  select 3 if from dual
      8  )
      9  ,t2 as
    10  (
    11  select 1 if from dual union all
    12  select 2 if from dual union all
    13  select 3 if from dual union all
    14  select 4 if from dual union all
    15  select 5 if from dual
    16  )
    17  (select if from t
    18  union all
    19  select if from t2)
    20  minus
    21  select -99 from dual
    22  /
            IF
             1
             2
             3
             4
             5
    SQL>

  • Need sql query to find ten records in sequential manner

    Plz help me
    I need to have ten records on my page. at the bottom of the page, i want to dispaly the number of pages that have records , just as a google page shows at the bottom. if the moves user moves to the next page , the next ten records must be displayed. suppose the user selects and clicks 5th page then the records on that page are displayed.How can i write the sql query corresponding to this specificationi don't want all records to be fetched at the same time and put on the server, rather whenever the page is opened , the corresponding records are fetched and displayed

    Hi
    Maybe you should use a CachedRowSet.
    Look this:
    http://developer.java.sun.com/developer/technicalArticles/javaserverpages/cachedrowset/
    This page has a example that will help you.

  • Need sql query outpout

    Hi All,
    i have input like
    'JEFFRJON-Sales Manager-JEFFRJON'
    'TBH01-JEFFRJON-Apps Agile Rep-JEFFRJON'
    Need output only
    Sales Manager
    Apps Agile Rep
    Please give me the sql query for this....

    anbarasan wrote:
    Hi All,
    i have input like
    'JEFFRJON-Sales Manager-JEFFRJON'
    'TBH01-JEFFRJON-Apps Agile Rep-JEFFRJON'
    Need output only
    Sales Manager
    Apps Agile Rep
    Please give me the sql query for this....You should really provide more info - like database version - so that people don't have to make assumptions when they try to help you. Based on limited requirements;
    with t as (
      select 'JEFFRJON-Sales Manager-JEFFRJON' str from dual union all
      select 'TBH01-JEFFRJON-Apps Agile Rep-JEFFRJON' from dual)
    select regexp_replace(str, '(.*JEFFRJON-)(.*)(-JEFFRJON.*)','\2') c
    from t;
    C
    Sales Manager
    Apps Agile Rep

  • Need sql query for like operation.

    Hi All,
    i have table like name column and contain the data like
    ibm 100
    ibm 200
    ibm 300
    a2b
    a
    b
    c
    like this ....
    but sql query need search using like or any regular expression---
    select * from table where name like (ibm 200 and ibm 300).
    and i don't want use like this select * from table where name like' ibm 200' or name like 'ibm 300').
    can you please any body help to correct the above query...
    Edited by: anbarasan on Oct 16, 2011 10:02 PM

    WITH t AS
         (SELECT 'ibm 100' NAME
            FROM DUAL
          UNION ALL
          SELECT 'ibm 200' NAME
            FROM DUAL
          UNION ALL
          SELECT 'ibm 300' NAME
            FROM DUAL
          UNION ALL
          SELECT 'a2b' NAME
            FROM DUAL)
    SELECT *from t where    REGEXP_LIKE (name, 'ibm')
    and REGEXP_LIKE (name, '100|200')

  • Need SQl Query for Revenue Code and Revenue Amount in Receivables

    Hi,
    I need a SQL Query to develop data set for the following columns:
    Revenue Code,Revenue Code Description,Invoice Amount,Revenue Amount,Original Invoice Number,Original Invoice Date.
    Can i get from ra_cust_trx_line_gl_dist_all and ra_customer_trx_all and ra_customer_trx_lines_all by joining them.But for the columns whcih to take
    i am in dilemma.
    Kindly any help will be needful for me

    Hi,
    I need a SQL Query to develop data set for the following columns:
    Revenue Code,Revenue Code Description,Invoice Amount,Revenue Amount,Original Invoice Number,Original Invoice Date.
    Can i get from ra_cust_trx_line_gl_dist_all and ra_customer_trx_all and ra_customer_trx_lines_all by joining them.But for the columns whcih to take
    i am in dilemma.
    Kindly any help will be needful for me

  • SQL query tunning help

    Hi All,
    Could you please help me out the below SQL query tuning .
    Temp table is having 1 Million records
    Master table is having 60 Million records
    Query :
    SELECT B.*,U.ID, SD, LE, LAE
    FROM client.Temp B, client.Master
    U WHERE U.policyno = B.policyno
    AND B.UPFLAG = 0
    1.     Indexes are created on both email columns and Upflag for both tables.
    2.     Gathered DBMS Stats for MASTER Table
    Data is loading 100k/hour on production .

    When your query takes too long ...
    When your query takes too long ...
    HOW TO: Post a SQL statement tuning request - template posting
    HOW TO: Post a SQL statement tuning request - template posting

  • Need sql query or pl/sql query urgent

    Hi Experts,
    The requirement is that
    SELECT 'N' flag, sysdate init_date,
    '' vendor_name,
    DECODE (pa.address_type,
    'P', 'Present Address',
    'R', 'Permanent Address',
    pa.address_type
    ) address_type,
    pa.address_line1
    || ','
    || pa.address_line2
    || ','
    || pa.town_or_city
    || ','
    || meaning
    || ','
    || pa.POSTAL_CODE "Address",
    TRUNC (TO_CHAR (pa.date_from, 'YYYY')) YEAR,
    TO_CHAR (pa.date_from, 'MON') MONTH,''station
    FROM per_addresses pa, fnd_lookup_values, per_all_people_f pf
    WHERE (pf.employee_number = :1 or pf.APPLICANT_NUMBER = :2)
    and pf.EFFECTIVE_END_DATE='31-DEC-4712'
    AND pa.person_id = pf.person_id
    AND pa.business_group_id = 42
    --AND pa.date_to IS NULL
    AND lookup_type = 'PER_US_COUNTRY_CODE'
    AND lookup_code = pa.country
    AND enabled_flag = 'Y'
    AND (end_date_active IS NULL OR end_date_active > SYSDATE)
    if i run the above query the output is coming like that
    Present Address |     Flat No. 1201, OC - 15, Orange County, Plot No. GH - 4,Ahinsa Khand 1st, Indrapuram,Ghaziabad,India,201010|     2,010|     JUL
    Permanent Address |     Q.No. 354, Sector - 3 / B,,Bokaro Steel City,India,827003     |2,010     |JUL
    Present Address |     4, Sitara,Chandra Reddy layout, S.T. Bed,Bangalore,India,0|     2,006|     JAN
    Present Address |     101,,Ushma Urja Apartments,Noida,India,201301 |     2,006 |     JUL
    Permanent Address |     F-19, Maccon Colony, Opp. DAV Shyamali School,,Ranchi,India,834002 |     2,009 |     FEB
    Present Address |     Flat no. 604, B - 1, Krishna Apra Gardens,Vaibhav Khand, Plot - 7,Ghaziabad,India,201010 |     2,009     FEB
    But the requirement is the output should come like that
    Permanent Address     |Q.No. 354, Sector - 3 / B,,Bokaro Steel City,India,827003|     2,010     |JUL                    
    Permanent Address 1|     F-19, Maccon Colony, Opp. DAV Shyamali School,,Ranchi,India,834002|     2,009 |     FEB
    Present Address |     Flat No. 1201, OC - 15, Orange County, Plot No. GH - 4,Ahinsa Khand 1st, Indrapuram,Ghaziabad,India,201010|     2,010 |     JUL                    
    Present Address 1 |     Flat no. 604, B - 1, Krishna Apra Gardens,Vaibhav Khand, Plot - 7,Ghaziabad,India,201010|     2,009 |     FEB                    
    Present Address 2 |     101,,Ushma Urja Apartments,Noida,India,201301|     2,006|     JUL     
    Present Address 3 |     4, Sitara,Chandra Reddy layout, S.T. Bed,Bangalore,India,0 |     2,006|     JAN     
    Please provide logice how i need to write a sql query or procedure or function or package
    Thanks & Regards
    Venu

    You can use analytics here :
    SELECT
        flag,
        init_date,
        vendor_name,
        address_type   ||' ' ||rn AS address_type,
        Address,
        YEAR,
        MONTH,
        station
    FROM
            SELECT
                'N' flag,
                sysdate init_date,
                '' vendor_name,
                DECODE (pa.address_type, 'P', 'Present Address', 'R','Permanent Address', pa.address_type ) address_type,
                row_number() over(partition BY pa.address_type order by 1) AS rn,
                pa.address_line1
                || ','
                || pa.address_line2
                || ','
                || pa.town_or_city
                || ','
                || meaning
                || ','
                || pa.POSTAL_CODE "Address",
                TRUNC (TO_CHAR (pa.date_from, 'YYYY')) YEAR,
                TO_CHAR (pa.date_from, 'MON') MONTH,
                '' station
            FROM
                per_addresses pa,
                fnd_lookup_values,
                per_all_people_f pf
            WHERE
                    pf.employee_number  = :1
                 OR pf.APPLICANT_NUMBER = :2
            AND pf.EFFECTIVE_END_DATE='31-DEC-4712'
            AND pa.person_id         = pf.person_id
            AND pa.business_group_id = 42
                --AND pa.date_to IS NULL
            AND lookup_type  = 'PER_US_COUNTRY_CODE'
            AND lookup_code  = pa.country
            AND enabled_flag = 'Y'
            AND
                    end_date_active IS NULL
                 OR end_date_active  > SYSDATE
        );

  • Need sql query for all employees list which are having lessthan maximum salary of manager in same departmnet;

    HI
    I want a sql query i.e., all employees list which are having lessthan maximum salary of manager in same departmnet;
    my table is like this
    employees
    EMPLOYEE_ID                               NOT NULL NUMBER(6)
    FIRST_NAME                                                   VARCHAR2(20)
    LAST_NAME                                 NOT NULL    VARCHAR2(25)
    EMAIL                                     NOT NULL          VARCHAR2(25)
    PHONE_NUMBER                                              VARCHAR2(20)
    HIRE_DATE                                 NOT NULL        DATE
    JOB_ID                                    NOT NULL           VARCHAR2(10)
    SALARY                                                           NUMBER(8,2)
    COMMISSION_PCT                                          NUMBER(2,2)
    MANAGER_ID                                                  NUMBER(6)
    DEPARTMENT_ID                                             NUMBER(4)
    if need the department table
    departments:
    DEPARTMENT_ID                        
    NOT NULL NUMBER(4)
    DEPARTMENT_NAME                      
    NOT NULL VARCHAR2(30)
    MANAGER_ID                                    
    NUMBER(6)
    LOCATION_ID                                   
    NUMBER(4)

    Try this:
    select
       employees.last_name || ', ' || employees.first_name “Employee”,
       employees.salary “Emp Salary”,
       sub.salary “Mgr Salary”,
       employees.department_id  “Department” 
    from
       employees,
       (  select
          mgr.department_id dept,
          max(mgr.salary) salary     
       from
          employees,
          employees mgr      
       where
          employees.mgr = mgr.employee_id      
       group by
          mgr.department_id) sub   
    where
       employees.department_id = sub.dept      
       and employees.salary < sub.salary
    Jeff

  • Need SQL query to get the result.

    Region
    Month
    Trx Type
    Resolution Summary
    AMERICAS
    May-13
    Adjustments
    Correct
    EMEA
    May-13
    Adjustments
    Incorrect
    AMERICAS
    May-13
    Credit Memo
    Incorrect
    EMEA
    May-13
    Invoice
    Correct
    AMERICAS
    May-13
    Credit Memo
    Correct
    OFD
    May-13
    Adjustments
    Correct
    AMERICAS
    May-13
    Invoice
    Incorrect
    LAD
    May-13
    Adjustments
    Correct
    LAD
    May-13
    Adjustments
    Correct
    OFD
    May-13
    Adjustments
    Correct
    Above is my Table and find below the required result.Similarly for other regions as well. Can anyone help me with the SQL Query?
    Region
    Resolution Summary
    Adjustment
    Credit Memo
    Invoice
    Grand Total
    AMERICAS
    Correct
    1
    1
    2
    Incorrect
    0
    1
    1
    2

    Like this?
    SQL> select * from transaction_audit;
    REGION   MTH    TRX_TYPE    RESOLUTIO
    AMERICAS may-13 ADJUSTMENTS CORRECT
    EMEA     may-13 ADJUSTMENTS INCORRECT
    AMERICAS may-13 CREDIT MEMO INCORRECT
    EMEA     may-13 INVOICE     CORRECT
    AMERICAS may-13 CREDIT MEMO CORRECT
    OFD      may-13 ADJUSTMENTS CORRECT
    AMERICAS may-13 INVOICE     INCORRECT
    LAD      may-13 ADJUSTMENTS CORRECT
    LAD      may-13 ADJUSTMENTS CORRECT
    OFD      may-13 ADJUSTMENTS CORRECT
    10 rows selected.
    SQL> select region
      2       , resolution_summary
      3       , count(decode(trx_type, 'ADJUSTMENTS', trx_type)) adjustments
      4       , count(decode(trx_type, 'CREDIT MEMO', trx_type)) credit_memo
      5       , count(decode(trx_type, 'INVOICE'    , trx_type)) invoice
      6    from transaction_audit
      7   group
      8      by region
      9       , resolution_summary
    10   order
    11      by region
    12       , resolution_summary
    13  /
    REGION   RESOLUTIO ADJUSTMENTS CREDIT_MEMO    INVOICE
    AMERICAS CORRECT             1           1          0
    AMERICAS INCORRECT           0           1          1
    EMEA     CORRECT             0           0          1
    EMEA     INCORRECT           1           0          0
    LAD      CORRECT             2           0          0
    OFD      CORRECT             2           0          0
    6 rows selected.
    SQL>

Maybe you are looking for

  • Need help connecting to my external HD on a PC remotely.

    I'm trying to connect to my external HD over the Internet on a PC. On my Mac, everything is working fine, I'm able to connect using the "File Sharing" ports. But, even though I already activated the "Windows File Sharing" ports, I still cannot connec

  • Adobe Reader 11.2.1 still crashing

    We are still having crash issues with Adobe 11.2.1. We are using Android 4.3 operating system. We have been using the same fillable forms since before the last two Adobe Reader updates in April 2014. These forms were not causing the program to crash

  • New Macbook - Keyboard freezes

    Hi, I bought a new 'Santa Rosa' Macbook on 11-2-07 and have been enjoying the process of setting it up and getting familiar with Leopard. One thing disturbs me though: Periodically as I have used it for the last two days, the keyboard will freeze, al

  • How do I get iPhoto to sync between my iMac and PowerBookPro?

    I'm trying to sync the iPhoto libraries with 700-800 photos each, many of them duplicates, on my iMac and my MacBookPro. And I'm not finding a way to do that. Apparently the Cloud only syncs them if I use Aperture, which I don't want to do. Anybody h

  • How to create 2 server instances in one directory

    Hi, I want to create 2 server instances in one directory . Is it possible ?? If yes how to do it ?? I know that using diff machines is it possible , but I want to create in single system itself. Thanks in advance, Rajendra.