Need SQl for

I have Table
create table EXAM
STUDENT_ID NUMBER,
MARKS NUMBER
Data for which looks like
STUDENT_ID     MARKS
10     100
20     300
30     200
10     600
20     400
30     300
10     500
20     700
30     900
So if I run this query
SELECT Student_id,marks ,
DENSE_RANK() OVER(PARTITION BY Student_id ORDER BY marks ) AS Rank
FROM exam
I get this
STUDENT_ID     MARKS     RANK
10     100     1
10     500     2
10     600     3
20     300     1
20     400     2
20     700     3
30     200     1
30     300     2
30     900     3
Now My Question is , How I can get the result in (Select statement Note I can write a function or procedure ) to Display Like
Student ID Mark_rank1 Mark_rank2 Mark_rank3
10 100 500 600
20 300 400 700
30 200 300 900
Here in Marks I can just upto 3 Ranks
Thanks In advance

The following should do it:
SELECT student_id
, max(decode(rank, 1, marks, NULL)) mark_rank1
, max(decode(rank, 2, marks, NULL)) mark_rank2
, max(decode(rank, 3, marks, NULL)) mark_rank3
FROM
(SELECT Student_id,marks ,
DENSE_RANK() OVER(PARTITION BY Student_id ORDER BY marks ) AS Rank
FROM exam)
GROUP BY student_id;
Note that if you have same marks, it will be only list once. If you want rank1, rank2 to be same if the first 2 marks same, you have to add some other logic there

Similar Messages

  • Need SQL for below scenerio .

    Hi Experts,
    Consider an Order Table with the following table structure with some Sample Data:
    ORDER_DAY
    ORDER_ID
    PRODUCT_ID
    QUANTITY
    PRICE
    01-JUL-11
    O1
    P1
    5
    5
    01-JUL-11
    O2
    P2
    2
    10
    01-JUL-11
    O3
    P3
    10
    25
    01-JUL-11
    O4
    P1
    20
    5
    02-JUL-11
    O5
    P3
    5
    25
    02-JUL-11
    O6
    P4
    6
    20
    02-JUL-11
    O7
    P1
    2
    5
    02-JUL-11
    O8
    P5
    1
    50
    02-JUL-11
    O9
    P6
    2
    50
    02-JUL-11
    O10
    P2
    4
    10
    Need  SQL to get all products that got sold both the days and the number of times the product is sold.
    Desired output :
    PRODUCT_ID
    COUNT
    P1
    3
    P2
    2
    P3
    2
    Thanks and Regards,
    Sumanth Kulkarni

    Hi,
    SumanthKulkarni wrote:
    Hi
    I tried below approach , but i didnt get desired output for P1
    select count(s) a,product_id  from
    (select count(product_id) s,order_day ,product_id from orders group by order_day,product_id
    order by product_id asc) t
    group by product_id
    having count(s) >1
    Thanks and Regards
    Sumanth Kulkarni
    Run the sub-query by itself, and look at the results.  You should see something like this:
             S ORDER_DAY   PRODUCT_ID
             2 01-JUN-2011 P1
             1 02-JUN-2011 P1
             1 01-JUN-2011 P2
    When you're computing the column a for the final output, do you want to count how many rows of this result set have product_id='P1'?  That's what COUNT does, but I don't think that's what you want.
    Do you want to add up the numbers in the S column?  Then use SUM (s), not COUNT (s).
    You could also do the whole job without a sub-query, like this:
    SELECT    COUNT (*)    AS a
    ,         product_id
    FROM      orders
    GROUP BY  product_id
    HAVING    COUNT (DISTINCT order_day)  > 1

  • Need Sql for terda data database

    Can any one help send me the sql for teradata database. for creating the variables. I need to create variables for Last month begin date and last month end date.

    I am trying this tera data Sql this is for curent month date.
    select cast(current_date as date) - (extract (day from cast(current_date as date)) - 1) + interval '1' month - 1
    I need tera data sql for Last month begin date and last month end date. I searched various forums but could not get the answer. Any suggesstions please.

  • Need Sql for this problem

    Hi Gurus
    I have below situtation which need to be sorted out by SQL (10g version)
    Below is the sample data.
    Date     Amt1     Amt2     Amt3     Totl
    201009     10     10     10     30
    201010     20     20     20     90
    201011     30     20     10     150
    Totl is the calculation field and remaining data is available in DB table say tab1. If you see logic of identifying Totl --> addition of Amt1,Amt2,Amt3 with Totl of prev month. For 201010 it is 20+20+20 =60 and this 60 will need to added to 201009 totl 30 and hence final sum is 90.
    Please provide to resolve this.

    You need to do cumulative sum.
    with t
    as
    select 201009 dt, 10 a1, 10 a2, 10 a3 from dual union all
    select 201010, 20, 20, 20 from dual union all
    select 201011, 30, 20, 10 from dual
    select dt, a1, a2, a3, sum(a1+a2+a3) over(order by dt) tot
      from t

  • Need sql for the following requirement

    EMP_DT EMP_TYPE emp_id
    01/01/2011               3 546
    01/03/2011 4 546
    01/05/2011 3 546
    01/08/2011 3 546
    01/09/2011 3 546
    01/10/2011 4 546
    01/12/2011 3 546
    01/14/2011 3 546
    01/16/2011 3 546
    01/18/2011 4 546
    01/19/2011 3 546
    Hi All,
    I have a table with two columns(emp date and type where date is mm/dd/yyyy type tied to employee).
    This data is inserted manually through online application. But behind the scenes I would like keep this date in the following fashion by a delete sql. When run the delete sql it should keep the data in following manner with employe type order 3,4,3,4,3,4 and so on. There shouldn't be any 3 empolyee type rows continuosly. Also when delete the data it should keep the smaller date out of three same employee type dates. example 01/12/2011,01/14/2011,01/16/2011 ---> we will keep the row 01/12/2011 and delete two other dates because they are same type of dates(3).
    EMP_DT EMP_TYPE emp_id
    01/01/2011               3 546
    01/03/2011 4 546
    01/05/2011 3 546
    01/10/2011 4 546
    01/12/2011 3 546
    01/18/2011 4 546
    01/19/2011 3 546

    Hi,
    So, on each row, you need to know what the value of emp_type was on the previous row. That sounds like a job for LAG.
    Here's one way to do that:
    WITH     got_prev_emp_type     AS
         SELECT     emp_dt, emp_type, emp_id
         ,     LAG (emp_type, 1, -1) OVER ( PARTITION BY  emp_id     -- Just guessing
                                                   ORDER BY      emp_dt
                                    ) AS prev_emp_type
         FROM    a_table
    --     WHERE     ...     -- If you need any filtering, put it here
    SELECT       emp_dt, emp_type, emp_id
    FROM       got_prev_emp_type
    WHERE       emp_type     != 3
    OR       prev_emp_type     != 3
    ORDER BY  emp_id
    ,            emp_dt
    ;This assumes that emp_dt is a DATE (or a TIMESTAMP). If it has some other dattype, convert it to a DATE.
    "DELETE" means "permanently remove rows from a table." Is that what you want, or do you just want to exclude some rows from a result set? The query above doesn't actually change the table. If that's what you want to do, you can use the query above as a sub-query in hte WHERE clause of a DELETE statement.
    DELETE  FROM  table_a
    WHERE  (emp_dt, ,emp_type, emp_id)   -- Just guessing
            NOT IN  (
                        WITH   got_prev_emp_type    AS
                    );This assumes that emp_dt, demp_type and demp_id are never NULL.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    If you're asking about a DML statement, such as DELETE, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using. All the code I psoted above assumes you have Oracle 9.1 or higher.

  • Need SQL for this simple logic..

    Hi,
    I have a select statement
    select msi.segment1,micv.CATEGORY_SET_NAME from
    MTL_system_ITEMs msi, MTL_ITEM_CATEGORIES_V micv where msi.INVENTORY_ITEM_ID = micv.INVENTORY_ITEM_ID
    and msi.ORGANIZATION_ID = 853 and msi.ORGANIZATION_ID = micv.ORGANIZATION_ID and
    msi.segment1 = 'C0005'
    which gives me output
    segment1 CATEGORY_SET_NAME
    C0005          Country Of Origin
    C0005          HS COMMODITY
    C0005          Inventory
    C0005          MFG PLANT
    C0005          Order Management Categories
    C0005          Purchasing Categories
    C0005          Sales and Marketing
    I have another select statement
    which gives me output
    segment1 CATEGORY_SET_NAME
    C2601ZE          Inventory
    C2601ZE          Sales and Marketing
    C2601ZE          Purchasing Categories
    C2601ZE          Order Management Categories
    C2601ZE          MFG PLANT
    Where there are 2 rows missing for part C2601ZE from 2nd select
    I want output like below for 2 missed rows which are from 2nd select
    segment1 CATEGORY_SET_NAME
    C2601ZE          Country Of Origin
    C2601ZE          HS COMMODITY
    MINUS is working but its working only for segment1 not for set_name
    Thanks in Advance
    Devender

    select msi.segment1,micv.CATEGORY_SET_NAME
    from MTL_system_ITEMs msi, MTL_ITEM_CATEGORIES_V micv
    where msi.INVENTORY_ITEM_ID = micv.INVENTORY_ITEM_ID
    and msi.ORGANIZATION_ID = 853
    and msi.ORGANIZATION_ID = micv.ORGANIZATION_ID
    and msi.segment1 = 'C2601ZE'
    and micv.CATEGORY_SET_NAME not in (
            select micv.CATEGORY_SET_NAME
            from MTL_system_ITEMs msi, MTL_ITEM_CATEGORIES_V micv
            where msi.INVENTORY_ITEM_ID = micv.INVENTORY_ITEM_ID
            and msi.ORGANIZATION_ID = 853
            and msi.ORGANIZATION_ID = micv.ORGANIZATION_ID
            and msi.segment1 = 'C0005');
    (Not Tested)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need sql for this logic

    Hi,
    Below is my table with columns like a,b,c
    a      b       c
    1     null   null
    null   2     null
    null  null   3
    I need output like a b c
                              1 2 3

    Hi,
    Here's one way
    SELECT  MIN (a)  AS a
    ,       MIN (b)  AS b
    ,       MIN (c)  AS c
    FROM    my_table;
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the query above is giving the wrong results, and explain, using specific examples, how you get the correct results from the given data in those places.  If you changed the query at all, post your code.Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Need help with SQL for Pie Chart

    I am trying to create a pie charge which would have 3 slices.
    Following sql gives me the expected values when I run the sql command:
    select
    round(avg(CATEGORY_1 + CATEGORY_2 + CATEGORY_3 + CATEGORY_4 + CATEGORY_5),0) "OD Engagements",
    round(avg(CATEGORY_6 + CATEGORY_7 + CATEGORY_13),0) "Talent Engagements",
    round(avg(CATEGORY_8 + CATEGORY_9 + CATEGORY_10 + CATEGORY_11 + CATEGORY_12),0) "Other Engagements"
    from OTD_PROJECT
    where STATUS in ('Open','Hold')
    I get 3 columns labeled: OD Engagements, Talent Engagements and Other Engagements with the correct averages based on the the data.
    I have tried several ways to try to get this to work in the SQL for a pie chart, but keep getting the invalid sql message and it won't save. I also tried saving without validation, but no data is shown on the chart at all.
    I want to have a pie, with 3 slices, one labeled OD Engagements with a value of 27, one labeled Talent Engagements with a value of 43 and one labeled Other Engagements with a value of 30. Then I want to be able to click on each pie slice to drill down to a secondary pie chart that shows the breakdown based on the categories included in that type.
    Since I am not grouping based on an existing field I an unsure what the link and label values should be in the chart sql.

    You'll need something like the below. I have no idea what the URL for the drilldown needs to be. It should create an appropriate link in your app for the particular slice. Mainly the code below breaks the SQL results into three rows rather than three columns. It may well have a syntax error since I can't test.
    select linkval  AS LINK,
           title    AS LABEL,
           calc_val AS VALUE
    FROM   (SELECT 'OD Engagements' AS title,
                   round(avg(CATEGORY_1 + CATEGORY_2 + CATEGORY_3 + CATEGORY_4 + CATEGORY_5),0) AS calc_val,
                   'f?p=???:???:' || v('APP_SESSION') || '::NO:?' AS LINKVAL
            from   OTD_PROJECT
            where  STATUS in ('Open','Hold')
            UNION ALL
            SELECT 'Talent Engagements' AS title,
                   round(avg(CATEGORY_6 + CATEGORY_7 + CATEGORY_13),0) AS calc_val,
                   'f?p=???:???:' || v('APP_SESSION') || '::NO:?' AS LINKVAL
            from   OTD_PROJECT
            where  STATUS in ('Open','Hold')
            UNION ALL
            SELECT 'Other Engagements' AS title,
                   round(avg(CATEGORY_8 + CATEGORY_9 + CATEGORY_10 + CATEGORY_11 + CATEGORY_12),0) AS calc_val,
                   'f?p=???:???:' || v('APP_SESSION') || '::NO:?' AS LINKVAL
            from   OTD_PROJECT
            where  STATUS in ('Open','Hold')
           );

  • Need help for learning how to develop interfaces for Oracle R12 EBS

    Hi all,
    I need to learn how to create interfaces in PL/SQL for Oracle R12 EBS Financials. I cannot find a good starting point for the documentation and examples to help me get started in this area. Would appreciate tips
    for this area.

    Hi,
    What kind of interfaces you are planning to develop?
    Oracle already provides list of APIs that can be used (in R12, it is responsibility).
    Oracle Integration Repository Documentation Resources Release 12 [ID 396116.1]
    Oracle Integration Repository
    http://irep.oracle.com/index.html
    If those APIs do not satisfy your requirements, you can refer to "Oracle Applications Developer" guide as well as SQL-PL/SQL guides.
    Applications Releases 11i and 12
    http://www.oracle.com/technetwork/documentation/applications-167706.html
    Database Documentation -- SQL-PL/SQL
    http://www.oracle.com/technetwork/database/enterprise-edition/documentation/index.html
    Thanks,
    Hussein

  • What is a efficient SQL for this query ?

    Hi,
    I am using 9.2 database. Suppose I am having following 2 tables
    Table p having only one column i.e. 'a'. Values in this column are
    a1
    b1
    c1
    d1
    Table Q having three columns a, b, c
    a1, 1, 100
    a1, 2, 50
    b1, 1, 30
    b1, 2, 40
    d1, 2, 90
    Table Q can be joined only using column a.
    Table Q can have multiple or no records for column a in table p. Based on above sample data, I want following output
    a1, 100, 50
    b1, 30, 40
    c1
    d1, 90
    Kindly tell be how can I achive this in most efiicient way !!!
    thanks & regards
    PJP

    I only have you two tracks about how do it.
    If you want all the columns from p with or wihout q you have to do:
    11:35:58 SQL> l
    1 select p.*, q.*
    2 from p,q
    3* where p.a = q.a (+)
    11:37:27 SQL> /
    For change the order of the colums for rows you can see the url, the are more examples like that only need to search "columns for rows" in this forums.
    Anyway:
    with rt as
    select 'a1' a, 1 b, 100 c from dual union
    select 'a1', 2, 50 from dual union
    select 'b1', 1, 30 from dual union
    select 'b1', 2, 40 from dual union
    select 'd1', 2, 90 from dual)
    --select * from rt
    select a, decode('1','0','0',rtrim(xmlagg(xmlelement(b, b || ',')).extract('//text()'),',')) b
    , decode('1','0','0',rtrim(xmlagg(xmlelement(c, c || ',')).extract('//text()'),','))
    from rt
    group by a
    Message was edited by:
    cth
    Other way:
    select a, ltrim(b,',') as b, ltrim(c,',') as c
    from (
    select row_number() over (partition by a order by length(b) desc) as rn, a, b,c
    from (select a, sys_connect_by_path(b, ',') as b,
              sys_connect_by_path(c, ',') as c
    from (
    select row_number() over (partition by a order by b) as rn, a, b,c
    from rt) y
    connect by rn = prior rn + 1 and prior a = a
    start with rn = 1
    where rn = 1
    Message was edited by:
    cth

  • Need SQL query using View - Please help

    Hi,
    I have similar requirement like below.
    I have two tables DEPT and EMP and some departments may not have employees. I have created below view, which displays all DEPT records, even though there are no emplyees.
    CREATE OR REPLACE VIEW dept_emp_vw AS
    SELECT deptno, empid, 0 AS selected
    FROM dept d, emp e
    WHERE d.deptno = e.deptnno (+);
    Ex.
    DEPTNO         EMPID        SELECTED
    10 101 0
    10 102 0
    20 103 0
    30 103 0
    40 104 0
    50 <null> 0
    Application will pass "empid" to the view (for ex. empid = 103) and I want result like below.
    Ex.
    DEPTNO         EMPID        SELECTED
    10 101 0
    10 102 0
    20 103 1
    30 103 1
    40 104 0
    50 <null> 0
    Can you please let me know the query using "dept_emp_vw" view. We have Oracle 11g Release 2.
    Thanks a lot for the help.

    Not possible using normal SQL - as SQL is not a procedure language and does not support variable declaration and use (e.g. passing empid as a variable and using it both as a predicate and as a condition in the SQL projection).
    That said - SQL can be "+parameterised+". An approach that is ugly and contrary to the basic design and use of SQL. But it can support the (very weird) view definition of yours.
    E.g.
    SQL> create or replace procedure SetVariable( name varchar2, value varchar2 ) is
      2  begin
      3          DBMS_SESSION.set_context( 'MyVariables', name, value );
      4  end;
      5  /
    Procedure created.
    SQL>
    SQL>
    SQL> create or replace context MyVariables using SetVariable;
    Context created.
    SQL>
    SQL> create or replace view my_funky_weird_view as
      2  select
      3          e.empno,
      4          e.ename,
      5          e.job,
      6          case e.empno
      7                  when to_number(sys_context( 'MyVariables', 'empid' )) then
      8                          0
      9                  else
    10                          1
    11          end     as "SELECTED"
    12  from       emp e
    13  /
    View created.
    SQL>
    SQL> exec SetVariable( 'empid', 7499 )
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select * from session_context where namespace = 'MYVARIABLES';
    NAMESPACE            ATTRIBUTE            VALUE
    MYVARIABLES          EMPID                7499
    SQL>
    SQL> select * from my_funky_weird_view order by selected;
         EMPNO ENAME      JOB               SELECTED
          7499 ALLEN      SALESMAN                 0
          7521 WARD       SALESMAN                 1
          7566 JONES      MANAGER                  1
          7654 MARTIN     SALESMAN                 1
          7698 BLAKE      MANAGER                  1
          7934 MILLER     CLERK                    1
          7788 SCOTT      ANALYST                  1
          7839 KING       PRESIDENT                1
          7844 TURNER     SALESMAN                 1
          7876 ADAMS      CLERK                    1
          7900 JAMES      CLERK                    1
          7902 FORD       ANALYST                  1
          7369 SMITH      CLERK                    1
          7782 CLARK      MANAGER                  1
    14 rows selected.
    SQL>But I will N\OT recommend doing it this way. It is not natural SQL as PL/SQL is needed to "+inject+" name-value pairs into the context for the SQL view to use. It is ugly. It is not standard. It cannot scale. It is complex to use. Etc.
    Yes, there are instances when this approach is exactly what one needs - when for example dealing with a trusted context and using the contents for implementing a security layer. But in the above case - I would rather want to see the actual business requirement first, as I think you're barking up the wrong tree with the view solution you have imagined.

  • 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

  • Equivalent of pl/sql for a tsql

    Can somebody post me the the equivalent of pl/sql for the below Tsql (Microsoft SQl Server)
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    SET ANSI_PADDING OFF
    GO
    CREATE TABLE [Localizations] (
    [pk] int NOT NULL IDENTITY(1, 1),
    [ResourceId] nvarchar(512) NOT NULL,
    [Value] ntext NOT NULL,
    [LocaleId] varchar(5) NOT NULL,
    [ResourceSet] nvarchar(512) NOT NULL,
    [Type] nvarchar(255) NOT NULL,
    [BinFile] image NULL,
    [TextFile] ntext NULL,
    [Filename] nvarchar(128) NOT NULL
    ON [PRIMARY]
    GO
    ALTER TABLE [Localizations]
    ADD
    CONSTRAINT [PK_Localizations]
    PRIMARY KEY
    ([pk])
    ON [PRIMARY]
    GO
    ALTER TABLE [Localizations]
    ADD
    CONSTRAINT [DF_Localizations_ControlId]
    DEFAULT ('') FOR [ResourceId]
    GO
    ALTER TABLE [Localizations]
    ADD
    CONSTRAINT [DF_Localizations_Filename]
    DEFAULT ('') FOR [Filename]
    GO
    ALTER TABLE [Localizations]
    ADD
    CONSTRAINT [DF_Localizations_LocaleId]
    DEFAULT ('') FOR [LocaleId]
    GO
    ALTER TABLE [Localizations]
    ADD
    CONSTRAINT [DF_Localizations_PageId]
    DEFAULT ('') FOR [ResourceSet]
    GO
    ALTER TABLE [Localizations]
    ADD
    CONSTRAINT [DF_Localizations_Text]
    DEFAULT ('') FOR [Value]
    GO
    ALTER TABLE [Localizations]
    ADD
    CONSTRAINT [DF_Localizations_Type]
    DEFAULT ('') FOR [Type]
    GO
    Edited by: user7722364 on Oct 19, 2009 8:18 AM

    The "default '' "(or null) constraints are not required.
    You need
    - a sequence instead of the identity column
    - a trigger to populate the sequence if it's not in the code
    then it's pretty similar
    - create table statement
    - create pk (which you could do as part of the create table statement if you wish)
    Whether you need NVARCHAR2 depends on your character set.

  • Can any one convert my SQL for Discoverer?

    This is a SQL you can run on the server but I was wondering if someone could convert the SQL for Discoverer?
    SQL:
    SELECT po.profile_option_name "NAME",
    po.USER_PROFILE_OPTION_NAME,
    decode(to_char(pov.level_id),
    ‘10001', ‘SITE’,
    ‘10002', ‘APP’,
    ‘10003', ‘RESP’,
    ‘10005', ‘SERVER’,
    ‘10006', ‘ORG’,
    ‘10004', ‘USER’, ‘???’) "LEV",
    decode(to_char(pov.level_id),
    ‘10001', ”,
    ‘10002', app.application_short_name,
    ‘10003', rsp.responsibility_key,
    ‘10005', svr.node_name,
    ‘10006', org.name,
    ‘10004', usr.user_name,
    ‘???’) "CONTEXT",
    pov.profile_option_value "VALUE"
    FROM FND_PROFILE_OPTIONS_VL po,
    FND_PROFILE_OPTION_VALUES pov,
    fnd_user usr,
    fnd_application app,
    fnd_responsibility rsp,
    fnd_nodes svr,
    hr_operating_units org
    WHERE po.profile_option_name LIKE ‘%&&profile%’
    AND pov.application_id = po.application_id
    AND pov.profile_option_id = po.profile_option_id
    AND usr.user_id (+) = pov.level_value
    AND rsp.application_id (+) = pov.level_value_application_id
    AND rsp.responsibility_id (+) = pov.level_value
    AND app.application_id (+) = pov.level_value
    AND svr.node_id (+) = pov.level_value
    AND org.organization_id (+) = pov.level_value
    AND decode(to_char(pov.level_id),
    ‘10001', ”,
    ‘10002', app.application_short_name,
    ‘10003', rsp.responsibility_key,
    ‘10005', svr.node_name,
    ‘10006', org.name,
    ‘10004', usr.user_name,
    ‘???’) LIKE ‘%&&username%’
    ORDER BY "NAME", pov.level_id, "VALUE";

    Hi,
    You can create a custom folder on using the administrator using the code,
    The only change is that you need the take off the conditions over the parameters and create those in the worksheet and not in the SQL.
    so you need to create the custom folder using:
    SELECT Po.Profile_Option_Name "NAME"
    *,Po.User_Profile_Option_Name*
    *,Decode(To_Char(Pov.Level_Id)*
    *,'10001'*
    *,'SITE'*
    *,'10002'*
    *,'APP'*
    *,'10003'*
    *,'RESP'*
    *,'10005'*
    *,'SERVER'*
    *,'10006'*
    *,'ORG'*
    *,'10004'*
    *,'USER'*
    *,'???') "LEV"*
    *,Decode(To_Char(Pov.Level_Id)*
    *,'10001'*
    *,'10002'*
    *,App.Application_Short_Name*
    *,'10003'*
    *,Rsp.Responsibility_Key*
    *,'10005'*
    *,Svr.Node_Name*
    *,'10006'*
    *,Org.NAME*
    *,'10004'*
    *,Usr.User_Name*
    *,'???') "CONTEXT"*
    *,Pov.Profile_Option_Value "VALUE"*
    FROM   Fnd_Profile_Options_Vl    Po
    *,Fnd_Profile_Option_Values Pov*
    *,Fnd_User Usr*
    *,Fnd_Application App*
    *,Fnd_Responsibility Rsp*
    *,Fnd_Nodes Svr*
    *,Hr_Operating_Units Org*
    WHERE  Pov.Application_Id = Po.Application_Id AND
    Pov.Profile_Option_Id = Po.Profile_Option_Id AND
    Usr.User_Id(+) = Pov.Level_Value AND
    Rsp.Application_Id(+) = Pov.Level_Value_Application_Id AND
    Rsp.Responsibility_Id(+) = Pov.Level_Value AND
    App.Application_Id(+) = Pov.Level_Value AND
    Svr.Node_Id(+) = Pov.Level_Value AND
    Org.Organization_Id(+) = Pov.Level_Value
    ORDER  BY "NAME"
    *,Pov.Level_Id*
    *,"VALUE";*
    Tamir

  • Need schematic for PLAYBOOK

    I really need schematic for my playbook...
    my playbook to be a deadbook now...
    please help me...

    i have not seen one yet
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

Maybe you are looking for

  • Initial load of mview on a prebuilt table

    We are using 9i Advanced Replication, materialized views. The situation is, we have a number of tables utilizing FAST or FORCE on PREBUILT TABLE. The master site database is already loaded and the mview logs have been created. The initial creation of

  • New iphone 5 not working properly

    Why my iphone not showing the plug icon on battery even it is 100% charge ,lightning icon is not changing .and also the rotation of the screen is not working ..what should i do?its is new just used it for one day.

  • Send several pdf attachments has one file

    I sent out an email today with 25 pdf files attached. The person who received it said she had to open each file to see it instead of the whole file being sent has one file. How do you do this?

  • FM or BAPI to change Maintenance plant and Planning Plant for an equipment

    Hi Experts, I need to change the Maintenance plant and Planning Plant for an equipment. Is there FM or BAPI available for the same? Thanks, Peri.

  • How to dynmatically create textbox using Javascript?

    Hi ALL, I did some googling but didnt found any success so posting thread into this forum, I have javascript something like this:- <script language="JavaScript" type="text/javascript"> function mandatory() var temp = document.getElementById('P3_STUDE