SQL help - lines, view by grouping...

Greetings!

Is this possible in Oracle 10 g using the SQL statement.

EMP table - EMPLID, DEPTID fields.
Data: E01, D01
E02, D01
E03, D01
E11, D11
E12, D11

I'm looking for output as follows using a SQL statement...

DeptID, EmplID
D01 E01
E02
E03
D11, E11
E12


Thanks in advance.

Try this:

WITH emp AS
(SELECT 'E01' emplid, 'D01' deptid FROM dual UNION ALL
 SELECT 'E02' emplid, 'D01' deptid FROM dual UNION ALL
 SELECT 'E03' emplid, 'D01' deptid FROM dual UNION ALL
 SELECT 'E11' emplid, 'D11' deptid FROM dual UNION ALL
 SELECT 'E12' emplid, 'D11' deptid FROM dual)
SELECT   CASE ROW_NUMBER () OVER (PARTITION BY deptid ORDER BY deptid)
         WHEN 1 THEN deptid||','||emplid
         ELSE emplid
         END dept_emp
FROM     emp
ORDER BY deptid,
         emplid

Tags: Database

Similar Questions

  • SQL help (line column... a little)

    I'm a little weird to write query. I want to turn rows into columns, but they must be grouped by line # as well. They will have to be group by tracking #...

    The other issue is, the system can have 5 minimum options and a maximum of 7. Here are the options...

    So, in reality, he will be taking a set of lines (misc 5-7) and returning to the side to make the columns. But, the new column headers are always defined like this max 7 and 2 can be cancelled on if not available...

    Confusing even explain... insert statement for example 2 below... we have 6, 7 criteria we met...

    ----------------------------------------------------------
    Sector of activity
    Type
    Did you review the user guide?
    Application
    Enter your Message
    Have you reviewed the FAQs?
    Tracking number of EIS
    -----------------------------------------------------------





    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323646, 'application', "DRI INT");
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323646, 'Enter your Message', 'test');
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323646, 'have you seen the FAQ document?', 'No');
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323646, 'have you reviewed the user's guide?', 'No');
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323646, "line of Business", "AUTO");
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323646, 'Type', 'Suggestion');
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323647, 'application', 'BEST');
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323647, 'Enter your Message', 'test');
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323647, 'have you seen the FAQ document?', 'No');
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323647, 'have you reviewed the user's guide?', 'Yes');
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323647, 'Number of EIS path', 'none');
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323647, "line of Business", "MAPS");
    Insert into the TABLE
    (FIELDVALUES CAN ONLY BE TRACKINGNUMBER, NM_PARM)
    Values
    (323647, 'Type', 'Question');
    COMMIT;
    with "TABLE" as
    (
    (select 323646 TRACKINGNUMBER, 'Application' NM_PARM, 'DRI INT' FIELDVALUES from dual)
    union all
    (select 323646 , 'Enter Your Message', 'test'  from dual)
    union all
    (select 323646 , 'Have you reviewed the FAQ document ?', 'No'  from dual)
    union all
    (select 323646 , 'Have you reviewed the User guide ?', 'No'  from dual)
    union all
    (select 323646 , 'Line Of Business', 'AUTO'  from dual)
    union all
    (select 323646 , 'Type', 'Suggestion'  from dual)
    union all
    (select 323647 , 'Application', 'BEST'  from dual)
    union all
    (select 323647 , 'Enter Your Message', 'test'  from dual)
    union all
    (select 323647 , 'Have you reviewed the FAQ document ?', 'No'  from dual)
    union all
    (select 323647 , 'Have you reviewed the User guide ?', 'Yes'  from dual)
    union all
    (select 323647 , 'ISW Tracking Number', 'none'  from dual)
    union all
    (select 323647 , 'Line Of Business', 'CARDS'  from dual)
    union all
    (select 323647 , 'Type', 'Question'  from dual)
    )
    , t as
    (
    select distinct TRACKINGNUMBER tn from "TABLE"
    )
    select
     (select FIELDVALUES from "TABLE" where NM_PARM = 'Application' and TRACKINGNUMBER = t.tn) "Application"
    ,(select FIELDVALUES from "TABLE" where NM_PARM = 'Enter Your Message' and TRACKINGNUMBER = t.tn) "Enter Your Message"
    ,(select FIELDVALUES from "TABLE" where NM_PARM = 'Have you reviewed the FAQ document ?' and TRACKINGNUMBER = t.tn) "Have you reviewed FAQ?"
    ,(select FIELDVALUES from "TABLE" where NM_PARM = 'Have you reviewed the User guide ?' and TRACKINGNUMBER = t.tn) "Have you reviewed User gui?"
    ,(select FIELDVALUES from "TABLE" where NM_PARM = 'ISW Tracking Number' and TRACKINGNUMBER = t.tn) "ISW Tracking Number"
    ,(select FIELDVALUES from "TABLE" where NM_PARM = 'Line Of Business' and TRACKINGNUMBER = t.tn) "Line Of Business"
    ,(select FIELDVALUES from "TABLE" where NM_PARM = 'Type' and TRACKINGNUMBER = t.tn) "Type"
    from t
    
    Application Enter Your Message Have you reviewed FAQ? Have you reviewed User gui? ISW Tracking Number Line Of Business Type
    ----------- ------------------ ---------------------- --------------------------- ------------------- ---------------- ----------
    DRI INT     test               No                     No                                              AUTO             Suggestion
    BEST        test               No                     Yes                         none                CARDS            Question   
    
  • Windows asks for a password when you try to access to the "view work group computers."

    We are on a network.  Main computer, that we can access through the receptionist connect you and access shared files on this computer.  Computer from the receptionist, windows asks for a password when you try to access to the "view work group computers."  We tried to use its password.  However, the shared files are still not accessible.

    Hello

    1. what happens when you enter the password?

    2. how many computers are connected to this working group?

    Refer to this link and check: You cannot access shared files and folders or browse computers in the workgroup with Windows XP

    http://support.Microsoft.com/kb/318030

    I hope this helps!

  • Help with summaries of group and excluding empty fields...

    I did bi publisher reports before but never with groups/group for each field counts. I can put the summary for the fields in each group, but it has all the lines in the Group and not just the data in the line. IE if there are 16 entities in the group, but only the dates of 13 of them I always get 16 total Group. I searched for more information otn and tried many things, but I just don't get it.

    Another problem I have - the model created with the bi Publisher - increase the power of the Word show no data when it uploaded to the server only the headers...
    what I am doing wrong?
    That's what I want my data to look like with the charges.

    Thanks for any help

    Rose

    ENTITY MAFUNIV GRFCUNIV GRFMFXDPC GRFMFXDPD FDCASPDPC FDCASPDPD
    2111 16 OCTOBER 08-14 OCTOBER 08 17 OCTOBER 08
    2112 15 OCTOBER 08
    2118 15 OCTOBER 08-15 OCTOBER 08
    2122 16 OCTOBER 08-15 OCTOBER 08
    2126 16 OCTOBER 08-15 OCTOBER 08
    2130 16 OCTOBER 08
    2131 16 OCTOBER 08-15 OCTOBER 08
    2133 16 OCTOBER 08-15 OCTOBER 08
    2135 16 OCTOBER 08-15 OCTOBER 08
    2141 16 OCTOBER 08-15 OCTOBER 08
    2144 16 OCTOBER 08-15 OCTOBER 08
    2146 16 OCTOBER 08-15 OCTOBER 08
    2147 16 OCTOBER 08-15 OCTOBER 08
    2152 17 OCTOBER 08-15 OCTOBER 08
    2153 16 OCTOBER 08-15 OCTOBER 08
    15 15 (13)


    <? XML version = "1.0"? >
    < results >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2111]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [14 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA [17 October 08]] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2112]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA []] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2118]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2122]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2126]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2130]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA []] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2131]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2133]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2135]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2141]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2144]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2146]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2147]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2152]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [17 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Boston]] > < / RONAME >
    < ENTITY > <! [CDATA [2153]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [New York]] > < / RONAME >
    < ENTITY > <! [CDATA [2214]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA [17 October 08]] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [New York]] > < / RONAME >
    < ENTITY > <! [CDATA [2217]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [New York]] > < / RONAME >
    < ENTITY > <! [CDATA [2221]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [New York]] > < / RONAME >
    < ENTITY > <! [CDATA [2226]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [New York]] > < / RONAME >
    < ENTITY > <! [CDATA [2227]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [New York]] > < / RONAME >
    < ENTITY > <! [CDATA [2229]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [New York]] > < / RONAME >
    < ENTITY > <! [CDATA [2233]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [New York]] > < / RONAME >
    < ENTITY > <! [CDATA [2235]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [New York]] > < / RONAME >
    < ENTITY > <! [CDATA [2242]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2311]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA [15 October 08]] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2312]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [10 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [10 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA [17 October 08]] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2315]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA [17 October 08]] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2316]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2318]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2324]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [15 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2327]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2331]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2333]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA []] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2339]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2343]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < row >
    < RONAME > <! [CDATA [Philadelphia]] > < / RONAME >
    < ENTITY > <! [CDATA [2344]] > < / FEATURE >
    < MAFUNIV > <! [CDATA [16 October 08]] > < / MAFUNIV >
    < GRFCUNIV > <! [CDATA [15 October 08]] > < / GRFCUNIV >
    < GRFMFXDPC > <! [CDATA []] > < / GRFMFXDPC >
    < GRFMFXDPD > <! [CDATA []] > < / GRFMFXDPD >
    < FDCASPDPC > <! [CDATA []] > < / FDCASPDPC >
    < FDCASPDPD > <! [CDATA []] > < / FDCASPDPD >
    < / row >
    < / results >

    would give the count of all the non-null GRFCUNIV.

    If you want the total of all of the xml data, regardless of grouping.

  • Try to install CS4 Design Premium - disabled since the old computer, new computer does not accept my serial number.  Just wasted 2 hours on Adobe help line.

    Try to install CS4 Design Premium - disabled since the old computer, new computer does not accept my serial number.  Just wasted 2 hours on Adobe help line.

    I sent you a private message that will help you (I hope).

    because scammers can continue to check this thread, I don't want to enter here information that could help them and this is the reason why I deleted your last post and sent you a private message.

  • Assignment of sequential numbers for all lines in a group of records

    The scenario is:
    This Recordset with group number, let's say 100 (group number) contains 7 rows/records. How to assign numbers (sequential) line for each line within these groups on the fly during the mapping process before inserting these lines set in the target. I know it's easy to achieve in a procedure, but do not know how to do the mapping.
    Please advice.

    Thank you
    Prabha

    In your aggregates of mapping use the function Rank as described above

    Hope it will work

  • SQL Help: How to collect summary number in group by?


    Hello

    I have the following table:

    create table tb_class_info (classNbr number (5), number (2) of ClassType, classTeacherNbr number (4));

    insert into tb_class_info values (101, 1, 12);

    insert into tb_class_info values (001, 2, 12);

    insert into tb_class_info_values (001, 2, 13);

    insert into tb_class_info_values (002, 2, 12);

    insert into tb_class_info_values (002, 2, 12);

    I would like to get statistics on the cnt, cnt for classType = 2 classTeacherNbr classNbr. I expect to have the following results:

    classNbr classType2Cnt classTeacherCnt

    101                0                         0

    001                2                          2

    002                2                          1

    The following SQL code I use:

    SELECT classNbr,

    SUM (CASE when classType = 2 THEN 1 ELSE END 0) as classTypeCnt,

    SUM (CASE when classType = 2 SO unique classTeacherNbr ELSE 0 END) as classTeacherCnt

    OF tb_class_info

    GROUP BY classNbr;

    However, I have the ' ORA-00905: lack of keyword ' error. Any suggestion on this subject?

    Thanks for your help!

    Select classnbr

    sum (case when classtype = 2 then 1 end)

    , count (distinct case when classtype = 2 then teachernbr end)

    of tb_class_into

    Classnbr group;

  • HELP Please - less 'lines' of a group leaving them transparent/contours...

    Hiya

    I was wondering if someone can help me please... it drives me crazy that it's so simple! Best way to describe what I want to do is really to look at the image below - I'm getting less the white lines of the black group, leaving that area transparent.  The two lines are fair paths with a line on it.  If I do the front less he removes the entire Wick where S straddles him T... you would be grateful is someone could point me in the right direction...

    I use Illustrator CS5 on mac...

    Thank you very much

    T

    Screen shot 2011-08-21 at 11.10.38.png

    Another method without using the white lines:

    1. select them "."

    2. from the menu bar: object > path > offset

    3. Enter an amount for the offset (click the Preview checkbox). Click OK.

    4. with the new path still selected, shift click on 't'.

    5 pathfinder > less prior

  • SQL help, how to group in column A and then get a higher frequency in column B?

    Assuming that the following table, operation represents each type of operation of transaction
    Employee table operation another column c
    ' < ' id1
    ' < ' id1
    ' < ' id2
    ' *' id3
    id1 ' / '.

    question, for each operation, which employee do the most? which employee do the 2nd most?
    I thought I need to group by operation first, then get the frequency of the employee and get top 1, or at the top of page 2 of higher frequency.
    But I'm struct and don't know how to write sql code.

    998408 wrote:
    Assuming that the following table, operation represents each type of operation of transaction
    Employee table operation another column c
    '<'>
    '<'>
    '<'>
    ' *' id3
    id1 ' / '.

    question, for each operation, which employee do the most? which employee do the 2nd most?
    I thought I need to group by operation first, then get the frequency of the employee and get top 1, or at the top of page 2 of higher frequency.
    But I'm struct and don't know how to write sql code.

    Welcome to OTN. OPS! Posted in the wrong forum. Just after in {forum: id = 75}. Before posting it close this thread as answered marking.

    If someone answer is useful or appropriate, please mark accordingly. *

  • SQL Help: convert values in two rows in a line

    Hello

    I am using Oracle 11.2, I want to get the values in different rows in the Tb_a table and insert them into the TB_b table as suite:

    create a Tb_a (number (5) id, init_dt date, upd_dt date, addr varchar2 (32));
    create a Tb_b (number (5) id, date upd_dt, addr varchar2 (32), dated hist_dt);

    insert into Tb_a values (101, to_date('ddmmyyyy','21/08/1990'), to_date('ddmmyyyy','22/08/1990'), "address1");
    insert into Tb_a values (101, to_date ('ddmmyyyy', 21 August 1991 '), to_date ('ddmmyyyy', 22 August 1991 '), "address2");
    insert into Tb_a values (101, to_date('ddmmyyyy','21/08/1992'), to_date('ddmmyyyy','22/08/1992'), "address3");
    insert into Tb_a values (102, to_date('ddmmyyyy','24/08/1990'), to_date('ddmmyyyy','25/08/1990'), 'address_address');

    I would like to have data in TB_b as follows.
    101, 22 August 1990 ","address1", August 21, 1991"
    101, August 22, 1991 ","address2", August 21, 1992 '"
    101, August 22, 1992 ', 'address3', null
    102, 25 August 1990 ', 'address_address', null

    Suggest on the SQL to perform the conversion of Tb_a to Tb_b?

    Thank you

    939569 wrote:
    I wish that each line of TB_b has the same value to the ID of the column, upd_dt and addr as Tb_a and the next value in the crt_dt of the Tb_a column.

    Or table has a column called crt_dt. Do you mean init_dt?

    This rule applies to the same ID only. How can I use LEAD on different ID, not the whole picture?

    Inlcude

    PARTITION BY id
    

    in the analytical clause, like this:

    INSERT INTO  tb_b ( id
                            , upd_dt
                , addr
                , hist_dt
                )
    SELECT  id
    ,     init_dt
    ,     addr
    ,     LEAD (init_dt) OVER ( PARTITION BY  id
                                     ORDER BY         init_dt
                       )
    FROM    tb_a;
    
  • SQL help with creating a view

    Hi, I am looking to create a view that needs, based on a table.
    Table:
    Roll, Code, Qual, Date
    1 05 KO 112010
    1 35 01 112010
    1 98 01 132011
    etc...
    I need only the row (roll) code 05 and ko but this roller should have a line with Code 35 Qual 01 with the same Date. I am able to get all the lines have the right Codes (05 and KO with 35 and 01). I don't know how I can then join it on itself to give me just the line 05/ko where correspond to the date and rollers.

    Try this not tested.

    In addition, the date of which as column name isn't suggestable. Change it if possible.

    create view v1
    as
    select * from rolltable r
    where code=05
    and qual='KO'
    and exists (select * from rolltable where code= 35 and Qual='01' and roll=r.roll and date=r.date);
    
  • To view lines for each group

    Hi all

    I have a static label on every row, and I use for each group of extraction of values for each row.
    Sometimes, while I have no value in XML for a specific line. When this happens the line of this static label will not appear in the preview.
    Is it possible to display this line of static label even its value were not observed in the XML file.

    Thanks in advance.

    I received several emails, don't know, the one who first ;)

    Just replied with model with fix: name of the Group coded hard and zero values, even if this isn't on the xml data

  • Help with error - 934 group function is not allowed here

    Hey there will, I'm having problems with a request and just does not know how to do it without error.

    I'm trying to get all the employee emerging infectious diseases that have less than 2 number max of DID (dependants) in the table.

    It's my current query

    SELECT Employee.LName. ' ' || Employee.Fname as Full_Name, Employee.EID

    The left outer JOIN employee depends on Employee.EID = Dependent.EID

    Having Count (DID)--2 > ((select Max (N) as From (SELECT Employee.EID, Count (DID) As N FROM Employee Inner Join Dependent On Employee.EID = Dependent.EID group by Employee.EID, Count (DID))) N)

    Order of Employee.Lname, Employee.Fname

    Which gives me an error on column 4, no matter what I do. If I remove the Count (DID) in the group by clause (which I tried it earlier), it gives me a is not an error of the function of single group...

    The most frustrating thing is that

    Select Max (N) as From (SELECT Employee.EID, Count (DID) As N FROM Employee Inner Join Dependent On Employee.EID = Dependent.EID group by Employee.EID) N

    Works perfectly, but because it's a mission, I have to do in one step (no substeps/views)

    Any help?

    Thank you very much

    Hello

    ac981e5d-D10A-4520-BF42-23a894d04fb7 wrote:

    Ok. I'm taking your code in a view... I get this.

    and there is an orange underscore and a text of the error that says

    Select incoherent list in group by... change the group by clause of e.fname, e.lname, e.eid, count, max

    Which isn't what either the Oracle database would do.  Everything about orange (or any other color) sounds like it is caused by a front-end that could be interacting with Oracle.  In addition, the Oracle error messages always come with a 3-letter-5 code, as ORA-00933.

    under the selection internal (first medium)

    You have deleted the WITH clause.  The parser can recognize the error when it has reached the first left parenthesis.

    Create view AS A10T2

    (

    SELECT e.lname. ' ' || e.fname AS full_name

    e.eid

    (D.) AS this_group_count

    MAX (COUNT (d.)) ON (AS highest_group_count)

    E employee

    LEFT OUTER JOIN dependent d ON e.eid = d.eid

    GROUP BY e.lname, e.fname, e.eid

    )

    SELECT full_name

    eid

    Of aggregate_results

    WHERE this_group_count > = highest_group_count - 2

    ORDER BY full_name

    You need the WITH to define this clause means "AGGREGATE_RESULTS":

    Create view AS A10T2

    WITH aggregate_results AS

    (

    SELECT e.lname. ' ' || e.fname AS full_name

    ...

    Why do you have an ORDER BY clause in a view?   (It is probably not cause of your errors, just make the inefficient view)

    Command line error: column 5: 23

    Error report-

    SQL error: ORA-00933: SQL not correctly completed command

    00933 00000 - "not correctly completed SQL command.

    * Cause:

    * Action:

    This is another indication that some front is getting involved.  Looks like your front-end reports the exact Oracle error message, "0RA-00933" and then builing it's own error code, "00933. 00000 ", on this basis.  ORA-00933 is a reasonable mistake to wait if you omit the line ' WITH the aggregated results AS.  Once again, until I can actually run your code, I can't test it, and I can't run your code until you post CREATE TABLE and INSERT statements for some examples of data, or change the problem to use commonly available tables, such as those in the scott schema.

    and when I try my code

    CREATE VIEW A10T2 AS

    SELECT Employee.LName. ' ' || Employee.Fname as Full_Name, Employee.EID

    The left outer JOIN employee depends on Employee.EID = Dependent.EID

    Seen (Count (DID)) + 2 > (select Max (N) From (SELECT Employee.EID, Count (DID) As "N" FROM Employee Inner Join Dependent On Employee.EID = Dependent.EID group by Employee.EID))

    Order of Employee.Lname, Employee.Fname

    I get

    Command line error: column 2: 8

    Error report-

    SQL error: ORA-00937: not a function of simple-group

    00937 00000 - 'not a single-group function.

    * Cause:

    * Action:

    Then the orange underscore even under my inner ("select employee. EID, Count (DID) as "N" ") says to change the Group of Employee.eid, Count (DID)

    I just don't understand why he tells me to group them by Count (DID)?

    Isn't that what you did in your original post, and I have explained in answer #2?  If you continue to repeat the same mistake, you can expect continue to get the same error.  Given that you have a code, you know causes an error, do you think really that what makes a vision will cause the error to disappear?

    The inner query works fine on its own...

    Right; It's the outer query where you are missing the GROUP BY clause.

  • Help line with MAX Date selection

    The data returned by my query currently looks like this.

    10 100 A 29 FEBRUARY 12

    11 101 OCTOBER 16, 12 B

    12 102 B 5 DECEMBER 12

    13 103 C 23 JANUARY 13

    When the data in the third column is duplicated, I want to only return the line with the most recent date in the 4th column (in this case row 3).

    So what I really want is the following.

    10 100 A 29 FEBRUARY 12

    12 102 B 5 DECEMBER 12

    13 103 C 23 JANUARY 13



    Any help would be greatly appreciated.

    Thank you

    Mark

    Here's a way...

    SQL > ed
    A written file afiedt.buf

    1 with t as (select 10 as the id, 100 such as seq, 'A' as the grp, date '' 2012-02-29 as dt of union double all the)
    2. Select 11, 101, 'B', date '' 2012-10-16 of all the double union
    3. Select 12, 102, 'B', date '' 2012-12-05 Union double all the
    4. Select 13, 103, 'C', date "double ' 2013-01-23)
    5  --
    6 select max (id) keep (dense_rank of the first order by dt desc) as id
    7, max (seq) keep (dense_rank of the first order by dt desc) as seq
    8, grp
    9, max (dt)
    10 t
    11 * grp group
    SQL > /.

    ID SEQ G MAX (DT)
    ---------- ---------- - --------------------
    10 100 WAS FEBRUARY 29, 2012 00:00:00
    12 102 B 5 DECEMBER 2012 00:00:00
    13 103 C 23 JANUARY 2013 00:00:00

  • Set the line report radio group when it is clicked on a link column.

    Can Hi anyone help?

    I have a sql report with a group on the left radio record selector, it is used on click to fill out some additional fields in the page. I also have a column of link on the right side of the report that is used to display another page in popup. What I want is to synchronize the group radio selector when the link is clicked (i.e. Select and click on the current online radio group when the link column is selected).

    Page layout

    RG1 link pencil icon line details
    RG2 link pencil icon line details
    RG3 link pencil icon line details

    additional field 1
    additional field 2

    Report of the attributes - link URL column.
    JAVASCRIPT: modalWin2 ('f? p = & APP_ID.: #SHOW #: & SESSION.: SAVE_STATUS: no);



    I guess I can call another function of javascript in the URL from the link above, and somehow, I get the number of the line of the selected link. I think that if I can get that I can use the code below, where n is the row number of the selected link.

    JavaScript: -.

    var l_check = $x_FormItems ($x('EVENT_HIST1'), 'radio');
    checked l_check [n] = true;
    var l_click is l_check [n] ravishing ();.

    Thanks, Pete

    Pete:

    One way to resolve your condition is as below

    Modify the report query to be something similar to

    select
    apex_item.radiogroup(40,empno,null,null,'id=rg_'||rownum) rad,
    ename,
    '' link_column
    from emp
    

    And the JS function fx as

    function fx(emp,rgId) {
    $x(rgId).checked=true;     // checks radio on this row
    modalWin2('f?p=&APP_ID.:' + emp + ':&SESSION.::::SAVE_STATUS:N'); // popup page call
    }
    

    CITY

Maybe you are looking for