Is that important column order in a query with row_number function

Hi folks,
I am using Oracle 11g R2 on HP-UX machine.
I have 2 types of query with row_number and I think they are same but output of each of them are different. I changed only column order in query2.
Query 1 :
(SELECT
"LOOKUP_INPUT_SUBQUERY"."CONTRACT_SK" "CONTRACT_SK",
"LOOKUP_INPUT_SUBQUERY"."SIMCARD_SK" "SIMCARD_SK"
FROM (
SELECT row_number ()
OVER (
PARTITION BY "R_CON_SUBS_SIMCARD_LK".
"CONTRACT_SK"
ORDER BY
"R_CON_SUBS_SIMCARD_LK"."START_DATE" DESC,
"R_CON_SUBS_SIMCARD_LK"."SEQ_NUM" DESC NULLS LAST) /* EXPRESSION_3.OUTGRP1.SIRA */
"SIRA",
"R_CON_SUBS_SIMCARD_LK"."CONTRACT_SK" "CONTRACT_SK",
"R_CON_SUBS_SIMCARD_LK"."SIMCARD_SK" "SIMCARD_SK"
FROM "SRC_OZRDS"."R_CON_SUBS_SIMCARD_LK" "R_CON_SUBS_SIMCARD_LK")
"LOOKUP_INPUT_SUBQUERY"
WHERE ("LOOKUP_INPUT_SUBQUERY"."SIRA" = 1))
Output of this like that :
CONTRACT_SK SIMCARD_SK
1     1
1     3
1     4
1     5
1     6
1     11
1     12
1     14
1     15
1     16
Query 2 :
(SELECT
"LOOKUP_INPUT_SUBQUERY"."CONTRACT_SK" "CONTRACT_SK",
"LOOKUP_INPUT_SUBQUERY"."SIMCARD_SK" "SIMCARD_SK"
FROM (
SELECT
"R_CON_SUBS_SIMCARD_LK"."CONTRACT_SK" "CONTRACT_SK",
"R_CON_SUBS_SIMCARD_LK"."SIMCARD_SK" "SIMCARD_SK",
row_number ()
OVER (
PARTITION BY "R_CON_SUBS_SIMCARD_LK".
"CONTRACT_SK"
ORDER BY
"R_CON_SUBS_SIMCARD_LK"."START_DATE" DESC,
"R_CON_SUBS_SIMCARD_LK"."SEQ_NUM" DESC NULLS LAST) /* EXPRESSION_3.OUTGRP1.SIRA */
"SIRA"
FROM "SRC_OZRDS"."R_CON_SUBS_SIMCARD_LK" "R_CON_SUBS_SIMCARD_LK")
"LOOKUP_INPUT_SUBQUERY"
WHERE ("LOOKUP_INPUT_SUBQUERY"."SIRA" = 1))
Output of this like that:
2     874812
7     70097256
8     18734091
9     158024
10     815397739
13     22657919
19     83177779
20     82579529
22     5829949
23     35348926
25     3865978
I expected the second output, because there are lots of contract sk but there is one contract_sk in first query result. i did not get the point. What is the problem ?

user8649469 wrote:
I changed only column order in query2.So what else do you expect? If you order, for example, by last name, fist name don't you think rows will be returned in a different order (and therefore same row will have different row number) than ordering by first name, last name?
SY.

Similar Messages

  • Column order in SQL Query (PL/SQL function returning a query)

    Hi,
    when I define a PL/SQL function returning a query inside a region, I often find that the column order is arbitrarily changed.
    How do I enforce the column order ?
    Bye,
    Flavio

    I removed the 11th column called service_name from this dynamic query: and now the report says: report error:
    ORA-01403: no data found. I messed around with the Headiuns Type. It was set to Custom. I changed it to Column Names. There is no difference.
    I am not sure how to fix?
    declare topqry varchar2(32000);
    whereqry varchar2(32000);
    finalqry varchar2(32000);
    var_status varchar2(100);
    division_status varchar2(50);
    office_status varchar2(1000);
    user_status varchar2(1000);
    overdue_status varchar2(1000);
    begin
    if :P10_FALLBACK = 'All' then
    var_status:= ' and vp.status in (''FA'',''FBA'',''FBI'',''25%'',''50%'',''90%'',''Closed'') ';
    elsif :P10_FALLBACK = 'Active' then
    var_status:= ' and vp.status in (''FA'',''25%'',''50%'',''90%'',''FBA'') ';
    elsif :P10_FALLBACK = 'FB' then
    var_status:= ' and vp.status in (''FBA'',''FBI'') ';
    elsif :P10_FALLBACK = 'Closed' then
    var_status:= ' and vp.status in (''Closed'') ';
    elsif :P10_FALLBACK = 'Inactive' then
    var_status:= ' and vp.status in (''FBI'') ';
    end if;
    if :P10_DIVISION = 'All' then
    division_status:= ' and vp.vms_division in (''News'',''Ad Services'') ';
    elsif :P10_DIVISION = 'News' then
    division_status:= ' and vp.vms_division in (''News'') ';
    elsif :P10_DIVISION = 'Ad' then
    division_status:= ' and vp.vms_division in (''Ad Services'') ';
    end if;
    if :P10_OFFICE = '%' then
    office_status:= ' and OFFICE_ID in (select office
    from VMS_OFFICE_ACCESS
    where user_id = lower(:P0_user) ) ';
    else
    office_status:= ' and OFFICE_ID in :P10_OFFICE ';
    end if;
    if :P10_LIMIT_USER = '%' then
    user_status := ' and SALESPERSON in (select first_name || '' '' || last_name
    from VMS_PROSPECT_users u
    join vms_office_access o
    on u.office_id = OFFICE
    where o.user_id = lower(:P0_USER) ) ';
    else
    user_status:= ' and SALESPERSON in (:P10_LIMIT_USER ) ';
    end if;
    if :P10_SHOW_OVERDUE = 'Show' then
    overdue_status:= ' and target_close_date <= sysdate ';
    var_status:= ' and vp.status in (''25%'',''50%'',''90%'',''FBA'') ';
    else
    overdue_status:= ' and FIRST_APPOINTMENT between
    nvl(to_date(:P10_FIRST_APPT_START, ''mm/dd/yyyy''),FIRST_APPOINTMENT) and
    nvl(to_date(:P10_FIRST_APPT_END,''mm/dd/yyyy''),FIRST_APPOINTMENT) ';
    end if;
    topqry := 'SELECT OFFICE_ID ,vp.PROSPECT_ID ,ENTRY_DATE ,ACCOUNT , NEXT_CONTACT_DATE ,ACTION_STEP ,
    TARGET_CLOSE_DATE ,vp.STATUS ,SALESPERSON ,vp.SALES_TYPE ,service_name , FIRST_APPOINTMENT ,MODIFY_DATE ,EST_ANNUAL_REVENUE ,EST_INCREMENTAL_REVENUE ,
    pi.NOTES , pi.SALES_TYPE ,pi.STATUS ,Contact ,Origin_Source FROM VMS_PROSPECTING_ITEMS pi right outer join VMS_PROSPECTS vp on vp.PROSPECT_ID = pi.PROSPECT_ID left outer join VMS_SERVICES vs on vs.service_ID = pi.service_ID where 1 = 1 ';
    whereqry := ' and (not exists (select *
    from VMS_PROSPECTING_ITEMS i3
    where vp.prospect_id = i3.prospect_id)
    or exists (select *
    from VMS_PROSPECTING_ITEMS i2
    where i2.order_id = pi.order_id
    and active = ''Y'' )) and instr(upper(ACCOUNT),upper(nvl(:P10_ACCOUNT,ACCOUNT))) > 0 ';
    whereqry := whereqry || var_status || division_status || office_status || user_status || overdue_status;
    finalqry := topqry || whereqry;
    return finalqry ;
    end;

  • Change column order updateable sql query report APEX 4

    Hi all,
    I have a master detail page. Detail is SQL Query (updateable report)
    I want to change the column order but seems not possiible anymore in A4.
    In A3... on the right side of the report attributes it was possible to move columns up or down.
    path is Home>>Application Builder>>Application nnn >>Page xx >>Report Attributes
    It seems that A4 the move up or down functionality is hidden or the region is to small with no horizontal scrollbar.
    Is there a work_aorund?
    This is also the case when the pages are displayed in icon view when showing all pages using.
    Home >> Application Builder >>Application
    Most right icons are hidden after the about and task regions.
    The work-around here is to display the pages in report or detail view
    Maybe a fix needed for APEX4?
    have nice weekend!
    Hugo Perfors
    Enthousiastic APEX developer

    Hi,
    It could be your browser settings. Try zooiming out in the browser View - Zoom - Zoom Out.
    Regards

  • Creation of Z reports for client adding two more column that is Purcahse order and delivery dates with Internal order wise

    HI Experts,
    Can any one help me to add two more column for standard report that is purchase order and delivery dates for Internal order wise.
    But here problem is when i checked with ABAP team they said there is no standard functional module to add two column.
    Please note below :
    Selection criteria is: 1) controlling area
                                  2) Fiscal Year
                                  3) From date and To date
                                  4) Plan Version
                                  5) Order Group.
    My client suggested : S_ALR_87012993 this tcode to run, but we suggested with S_ALR_87013019 as in this tcode we can get all the details
    That is required output fields, as it is showing all details but on yearly basis, he wants this to be period wise and also Abap team is not able to find standard functional module in the second tcode as well.
    Out Put fields to Pop up
    1) Orders.
    2) Budget
    3) Actual
    4) commitment
    5) Alloted
    6) Available
    These are two additional column
    7)Purchase order
    8) Delivery date.
    Require your help to know which all tables are included to extract above out put fields please help me.
    Thanks in Advance.
    Regards,
    Sudesh

    Hi Preeti,
    Thanks for reply, can you please let me know is there any other way to show the output fields.
    As my client is very specific to run the report on period wise, i also tried to execute the standard tcode S_ALR_87013019 and were we are getting all the required outputs to pop up but this is on year wise, but we can also check by period basis by clicking on order number and actual period basis where we can see period basis.
    Also one more question,what is the commitment table which is popping up in this, please advise.
    Thanks in advance.
    Regards,
    Sudesh

  • SQL Azure - query with row_number() executes slow if columns with nvarchar of big size are included

    I am linking my question from Stack Overflow here. The link: http://stackoverflow.com/questions/27943913/sql-azure-query-with-row-number-executes-slow-if-columns-with-nvarchar-of-bi
    Appreciate your help!
    Gorgi

    Hi,
    Thanks for posting here.
    I suggest you to check this link and optimize your query on sql azure.
    http://www.sqlusa.com/articles/query-optimization/
    http://sqlblog.com/blogs/paul_white/archive/2011/02/23/Advanced-TSQL-Tuning-Why-Internals-Knowledge-Matters.aspx
    Also check this blog which had similar issue.
    https://social.msdn.microsoft.com/Forums/en-US/c1da08b4-265d-4ec8-a252-8d7090234e3e/simple-select-query-takes-long-time-to-execute-with-nvarchar-columns?forum=transactsql
    Girish Prajwal

  • SQL Query With analytical function

    Hi
    Below is the scenario which i am looking for in sql query using analytical functions
    I/p
    Col1
    50
    0
    -150
    -200
    300
    -100
    -300
    500
    -100
    O/p
    Col1          col2
    50                 0
    0                   0
    -150          -100
    -200              -200
    300               0
    -100              0
    -300              -100
    500               400
    -100              0Any help really appreciated
    Thanks in advance
    Edited by: unique on Aug 10, 2010 4:53 AM
    Edited by: unique on Aug 10, 2010 4:55 AM
    Edited by: unique on Aug 10, 2010 4:55 AM

    Oh,In this case,There is OLAP solution ;-)
    OLAP samples of my homepage http://www.geocities.jp/oraclesqlpuzzle/oracle-sql1-olap.html
    with work(SK,Val) as(
    select  1,  50 from dual union
    select  2,   0 from dual union
    select  3,-150 from dual union
    select  4,-200 from dual union
    select  5, 300 from dual union
    select  6,-100 from dual union
    select  7,-300 from dual union
    select  8, 500 from dual union
    select  9,-100 from dual)
    select SK,Val,GID,
    case when Val > 0
         then greatest(0,sum(Val) over(partition by GID))
         else Least(0,Val+greatest(0,sum(Val) over(partition by GID
                                     order by SK rows between unbounded preceding
                                                          and 1 preceding)))
         end as COL3
    from (select SK,Val,
          sum(greatest(0,sign(Val))) over(order by SK) as GID
          from work)
    order by SK;
    SK   VAL  GID  COL3
    1    50    1     0
    2     0    1     0
    3  -150    1  -100
    4  -200    1  -200
    5   300    2     0
    6  -100    2     0
    7  -300    2  -100
    8   500    3   400
    9  -100    3     0

  • Problem in Query with JOIN Function in OCRD CRD1 OCPR tables

    Hello Dear Forum Users,
    I want to make a query which shows me per business partner from OCRD - Addres; CRD1 - Delivery Address and from OCPR - Contactperson information
    Is it possible to show it in one row per Business Partner. Now I get (the classic problem) of several rows and a duplication of the contact persons per (delivery) address.
    My query is:
    SELECT T0.[CardCode], T0.[CardName], T1.[Address], T1.[Street], T1.[ZipCode], T1.[City], T1.[Country], T1.[U_TelNr], T1.[U_MobNr], T1.[U_OpenTijd], T1.[U_LosIns_1], T1.[U_LosIns_2],T2.[Title],  T2.[Name] as 'Voornaam', T2.[Address] as 'Achternaam', T2.[Position] as 'Functie', T2.[Tel1], T2.[Cellolar], T2.[E_MailL], T2.[BirthDate] FROM OCRD T0 LEFT OUTER JOIN CRD1 T1 ON T0.CardCode = T1.CardCode LEFT OUTER JOIN OCPR T2 ON T0.CardCode = T2.CardCode
    Can you help me ?
    Jos Dielemans - Maastricht
    Edited by: J. Dielemans on Apr 29, 2011 4:28 PM
    Changed the query with Left Outer Join

    I have found the solution myself:
    By using the Union All function I could combine two queries. Here is the result:
    SELECT
    T0.[CardCode], T0.[CardName], T1.[Address] , T1.[Street], T1.[ZipCode], T1.[City], T1.[Country], T1.[U_TelNr], T1.[U_OpenTijd] , T1.[U_LosIns_1] , T1.[U_LosIns_2]'
    FROM OCRD T0 LEFT OUTER JOIN CRD1 T1 ON T0.CardCode = T1.CardCode
    WHERE T0.[CardCode] >= 'D00000'
    Union all
    SELECT
    T0.[CardCode], T0.[CardName], T2.[Position], T2.[Tel1], T2.[Title],  T2.[Name], T2.[Address], T2.[Position], T2.[Tel1], T2.[Cellolar], T2.[E_MailL]
    FROM OCRD T0 LEFT OUTER JOIN OCPR T2 ON T0.CardCode = T2.CardCode
    WHERE T0.[CardCode] >= 'D00000'
    Order by 1
    Now i got the result I was looking for.

  • Query with sub functions

    Hi Experts,
    I have tried the below query with sub select function. could any one help me to fix this ?
    SELECT T0.[ItemCode], T0.[Dscription], T1.[OnHand],
    (Select distinct sum(T0.InQty) from OINM where T0.ItemCode = OINM.ItemCode and T0.DocDate = '2012/08/18' ) as 'OB Stock'
    FROM OINM T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
    WHERE T1.[OnHand] > 0   GROUP BY T0.[ItemCode], T0.[Dscription],  T1.[OnHand]
    thanks in advance,
    Regards,
    Dwarak

    Hi,
    This is for your Query.
    SELECT T0.[ItemCode], T0.[Dscription], T1.[OnHand],
    (Select distinct sum(T0.InQty) from OINM t0 where T0.ItemCode = T0.ItemCode and T0.DocDate = '2012/08/18'  ) as 'OB Stock'
    FROM OINM T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
    WHERE T1.[OnHand] > 0   GROUP BY T0.[ItemCode], T0.[Dscription],  T1.[OnHand]
    Regards,
    Kalaiyarasan.v

  • Column chart from Bex query with 2 characteristics in rows and column

    Hi,
    We're trying to represent the following column chart in Dashboard Design:
    Material/Month
    January
    February
    March
    Material 1
    100
    200
    300
    Material 2
    400
    500
    600
    Material 3
    700
    800
    900
    The BEX query has:
    Result objects: Material, Month/year; amount
    The problem is when i paste the Material dimension in the Excel, i'm getting the following result:
    Material/Month
    January
    February
    March
    Material 1
    100
    200
    300
    Material 1
    400
    500
    600
    Material 1
    700
    800
    900
    So, when i display the column chart, the material tag is incorrect:
    as the image attached shows.

    Hey Flora,
    Happy to hear that its working now.
    Answering your question, again its upto the connection and report format you are using. Based on your question i hope you your report output should be like this.
    You cannot map to two labels for the series, again this report format is possible only in cross tab through Webi. I would suggest you to concatenate the material and month in a dimension in webi like below.
    I have done the concatenation in excel level, i would suggest you to do that in webi. Try to reduce the formula as much in excel.
    or
    If you are using Query browser connection, then i would suggest you to create a separate report which will display the actual vs plan material wise, here you need to pass the material as a prompt.
    Hope this helps in clear, please revert me for any clarification.

  • Chart not getting columns from the SQL Query with InlineTransform(xsl)

    Hi All,
    I am using MII 12.0 . I tried to use the mii standard xsl for converting rows into columns by  Inline Transform in a SQL Query.
    while executing the Query it is giving me the correct output but i tried to load the same Query in a IChart there it is not showing me the available columns that i can able to see in simple executiion and chart is also not plotting it keeps on loading.
    Thanks in Advance.

    Hi LinoVaz,
    Some things to try for testing purposes -
    1. Don't do any Data Mapping of the query columns
    2. If a SQL Query, you may need to change the Server Scaling to use Global AutoScale.
    I found that when I mapped the inline-transformed query into a bar chart display template, and hit the Refresh button, only the first column name show in the Column Names area.  If I mapped it, I got only that column.  If I didn't map any columns, I got them all.
    Let me know if you find similar results.  I think this is likely a bug, so you may consider using a Business Logic Transaction and an XacuteQuery to accomplish the same result.
    Kind Regards,
    Diana Hoppe
    Edited by: Diana Hoppe on Mar 25, 2011 11:46 AM

  • Update of a table from a select query with aggregate functions.

    Hello All,
    I have problem here:
    I have 2 tables A(a1, a2, a3, a4, a4....... ) and B( a1, a2, b1, b2, b3). I need to calculate the avg(a4-a3), Max(a4-a3) and Min(a4-a3) and insert it into table B. If the foreign keys a1, a2 already exist in table B, I need to do an update of the computed values into column b1, b2 and b3 respectively, for a1, a2.
    Q1. Is it possible to do this with a single query ? I would prefer not to join A with B because the table A is very large. Also columns b1, b2 and b3 are non-nullable.
    Q2. Also if a4 and a3 are timestamps what is the best way to find the average? A difference of timestamps yields INTERVAL DAY TO SECOND over which the avg function doesn't seem to work. The averages, max and min in my case would be less than a day and hence all I need is to get the data in the hh:mm:ss format.
    As of now I'm using :
    TO_CHAR(TO_DATE(ABS(MOD(TRUNC(AVG(extract(hour FROM (last_modified_date - created_date))*3600 +
    extract( minute FROM (last_modified_date - created_date))*60 +
    extract( second FROM (last_modified_date - created_date)))
    ),86400)),'sssss'),'hh24":"mi":"ss') AS avg_time,
    But this is very long drawn. Something more compact and efficient would be nice.
    Thanks in advance for your inputs.
    Edited by: 847764 on Mar 27, 2011 5:35 PM

    847764 wrote:
    Hi,
    Thanks everyone for such fast replies. Malakshinov's example worked fine for me as far as updating the table goes. As for the timestamp computations, I'm posting additional info: Sorry, I don't understand.
    If Malakshinov's example worked for updating the table, but you still have problems, does that mean you have to do something else besides update the table? If so, what?
    Oracle version : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Here are the table details :
    DESC Table A
    Name Null Type
    ID               NOT NULL NUMBER
    A1               NOT NULL VARCHAR2(4)
    A2               NOT NULL VARCHAR2(40)
    A3               NOT NULL VARCHAR2(40)
    CREATED_DATE NOT NULL TIMESTAMP(6)
    LAST_MODIFIED_DATE TIMESTAMP(6) DESCribing the tables can help clarify some things, but it's no substitute for posting CREATE TABLE and INSERT statements. With only a description of the table, nobody can re-create the problem or test their ideas. Please post CREATE TABLE and INSERT statements for both tables as they exist before the MERGE. If table b doen't contain any rows before the MERGE, then just say so, but you still need to post a CREATE TABLE statement for both tables, and INSERT statements for table a.
    The objective is to compute the response times : avg (LAST_MODIFIED_DATE - CREATED_DATE), max (LAST_MODIFIED_DATE - CREATED_DATE) and min (LAST_MODIFIED_DATE - CREATED_DATE) grouped by A1 and A2 and store it in table B under AVG_T, MAX_T and MIN_T. Since AVG_T, MAX_T and MIN_T are only used for reporting purposes we have kept it as Varchar (though I think keeping it as timestamp would make more sense). I think a NUMBER would make more sense (the number of minutes, for example), or perhaps an INTERVAL DAY TO SECOND. If you stored a NUMBER, it would be easy to compute averages.
    In table B the times are stored in the format : hh:mm:ss. We don't need milliseconds precision. If you don;'t need milliseconds, then you should use DATE instead of TIMESTAMP. The functions for manipulating DATEs are much better.
    Hence I was calculating is as follows:
    -- Avg Time
    TO_CHAR(TO_DATE(ABS(MOD(TRUNC(AVG(extract(hour FROM (last_modified_date - created_date))*3600 +
    extract( minute FROM (last_modified_date - created_date))*60 +
    extract( second FROM (last_modified_date - created_date)))
    ),86400)),'sssss'),'hh24":"mi":"ss') AS avg_time,
    --Max Time
    extract (hour FROM MAX(last_modified_date - created_date))||':'||extract (minute FROM MAX(last_modified_date - created_date))||':'||TRUNC(extract (second FROM MAX(last_modified_date - created_date))) AS max_time,
    --Min Time
    extract (hour FROM MIN(last_modified_date - created_date))||':'||extract (minute FROM MIN(last_modified_date - created_date))||':'||TRUNC(extract (second FROM MIN(last_modified_date - created_date))) AS min_timeIs this something that has to be done before or after the MERGE?
    Post the complete statement.
    Is this part of a query? Where's the SELECT keyword?
    Is this part of a DML operation? Where's the INSERT, or UPDATE, or MERGE keyword?
    What are the exact results you want from this? Explain how you get those results.
    Is the code above getting the right results? Are you just asking if there's a better way to get the same results?
    You have to explain things very carefully. None of the people who want to help you are familiar with your application, or your needs.
    I just noticed that my reply is horribly formatted - apologies! I'm just getting the hang of it.Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Query with trim function running more than 15 hours..

    Hi,
    I have one select query which is running more than 15 hours.I have many trim() functions in that.and i have index for some columns for the tables that i used in that query.but it is not considering those indexes..
    select
    DISTINCT
    trim(A.x) x,
    trim(B.y) y,....... from A,B
    Can anyone tell why this query is taking more time?and is there any other way for using the trim function?
    Thanks in advance..

    Note the name of this forum is "SQL Developer *(Not for general SQL/PLSQL questions)*", so only for issues with the SQL Developer tool. Please post these questions under the dedicated [SQL And PL/SQL|https://forums.oracle.com/forums/forum.jspa?forumID=75] forum.
    Regards,
    K.

  • Creating a  query with group function and non group function

    Could anyone help me with creating a query that contain single row function and multiple row function in Report6i.
    what i want to do basically is to create a query that will display sum of certain columns according to a column in that table

    You can either calculate a sum yourself, or let Reports do it for you.
    1. select sum(column) from table where ....
    This will just display the sum, not the records.
    2. Make a query: select column from table where ...
    Create a summary field. You can do it manually or with the report wizard.
    That will create a report like this:
       Column
           10
           20
           15
       ======
    Sum    45                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Af:query with extra functionality

    Hello everyone,
    JDev: 11.1.1.3 (migrating to 11.1.1.5)
    We are using the af:query component as our standard query module (seems logical).
    Thanks to the Frank Nimphius "af:query component complex field validation" on the ADF Code Corner,
    it is clear how to do validation in an af:query component.
    What we want to do is the following : on an existing field, adding a link/icon that opens a popup that contains
    a taskflow, which contains a more complex query (again with af:query ;-)). The result of the tf should return
    into the field in the first af:query component.
    Is something like this possible?
    Thanks.
    Filip Huysmans.

    Filip,
    no, you can't
    Frank

  • Query with DECODE function

    My table has columns A,B & C with data as below
    A B C
    X 1 1
    1 X 1
    1 1 X
    Result should be all ‘Z’ inserted right to ‘X’ & must look like as below
    A B C
    X Z Z
    1 X Z
    1 1 X
    Please check the below query & help me to modify the query as the result for column b is not correct.
    select a,decode(b,'1','Z','X') b,decode(c,'1','Z','X') c
    from test;

    try
    With Data As
    Select 'X' A,'1' B, '1' C From Dual Union All
    Select '1','X','1' From Dual Union All
    Select '1','1','X' From Dual
    Select A, (Case When A ='X' And B='1' Then 'Z' Else B End) B,
    (Case When (A='X' Or B='X') And C='1' Then 'Z' Else C end)C 
    from dataVivek L

Maybe you are looking for

  • Need suggestion to achieve this functionality

    Hi, I was looking at cfgrid and cftree functionality. Is it possible to incorporate cftree within cfgrid. if I can create a tree like structure in cfgrid. I am looking for something like below: The hyphens would be replaced by checkboxes... - Folders

  • How do I open attachments to my emails. What app/prog do I need.

    I have just purchased Ipad 2. On receiving emails I find that I am unable to open attachments, either jpeg or video etc. Spoke to the ipad help line and despite following his directions, apart from googling for info, I am no further forward. Being a

  • Slow AdvancedDataGrid rendering

    Hello - I have a project that uses an AdvancedDataGrid with over 60 dynamically generated columns, grouped dynamically (there are three sub groupings above each actual colum), and fed with Hierarchical data. So each row of my ADG will expand one leve

  • Sun Studio 12 linker error

    When linking, I get the following error on Studio 12 under Solaris 5.10. It's a big program, which has been used for years and compiles fine with SUNPro62 Solaris 5.8 and 5.10 and using g++ on Linux RH3 and RH4, 322-bit and 64-bit. It's a heavily tem

  • Problems with shape distortion after warp effects

    Hello everybody, Just a quick and rather basic question I'm afraid. I made a circle, then an ellipse, I warped the ellipse in various different ways to achieve the exact shape I want. Then I merged them using the Pathfinder tool. So far so good. Howe