Changing the Column names / alias

Hi,
I have an oracle query and it works fine.
select q.sname,
SUM( decode(p.nprofile1,10,1,0)) as "0 - 5",
SUM( decode(p.nprofile1,9,1,0)) as "6 - 10",
SUM( decode(p.nprofile1,8,1,0)) as "11 - 15",
SUM( decode(p.nprofile1,7,1,0)) as "16 - 19",
SUM( decode(p.nprofile1,6,1,0)) as "20 - 20",
SUM( decode(p.nprofile1,5,1,0)) as "21 - 27",
SUM( decode(p.nprofile1,4,1,0)) as "28 - 30",
SUM( decode(p.nprofile1,3,1,0)) as "31 - 40",
SUM( decode(p.nprofile1,2,1,0)) as "41 - 45",
SUM( decode(p.nprofile1,1,1,0)) "46 - Over",
COUNT(q.sname) "TOTAL"
from task_core@cds t, cor_queue q, profile_core@crb p
where t.nmboxid = q.nmboxid
and p.ncodaid = t.nobjectid
and p.ntype=2
GROUP BY q.sname
ORDER BY q.sname
It generates a Cross-tab sort of result and I am using the decode function to generate the result.
My problem is that right now I am using hardcoded column names or alias for the columns generated by the decode function. eg. "0-5", "6-10" etc.
I have another table which contains these values ("0-5","6-10"). I would like to know instead of hard coding the column names like
SUM( decode(p.nprofile1,10,1,0)) as "0 - 5"
can we retrieve the values from the Other table that contains the values "0-5","6-10" etc and display it there in the decode function?
Pls help me with this issue
Thanks
Gilles

hi,
the column names are always fixed. You can try dynamic sql in pl/sql or spool then execute, but in pure sql, it is not possible

Similar Messages

  • How to change the column names in display

    Hi,
    I want to change the columns names and give the display names as more User friendly..
    How should I acheive this in WebI reports.
    Regards,
    BOB

    Hi,
    the columns names are normal text fields. Just selecdt to edit your report , go to the editor panel and select the column header you want to modify. You can enter the text you want to display
    Regards,
    Stratos

  • How to change the column name as bold in adf table

    Hi,
    How can I change the column name with bolder style and blue colour in adf Table?
    I changed the color and font weight in af:column properties, but its effecting the data in that column but not with the column Header Text property.(i have given column name in header text).
    can any one have any idea how to do this?
    and I have taken panel tabbed layout and in that i'm displaying this table.
    but this table has scroll beneath of it to show all columns.
    but i want to display all columns (for this, page should have scroll at the bottom side).
    how can I achieve this???

    Hi,
    Add the following CSS Code to the custom skin css file that is to be created as per the suggestions above.
    *af|column::column-header-cell{*
    color:Blue;
    font-weight:bold;
    This would ensure that all the table column headers are blue in color and bolder font style through-out the application.
    By the way, what version of JDeveloper are you using?
    Thanks,
    Navaneeth

  • BSP Changing the Column name

    Hi experts,
    I have used tableview in BSP . In the output it displays the column name as per the table which i have referred. I want to change the name of the column. How Should i do that.. anyone plz explain me with an example.
    Thanks in Advance
    Edited by: Vijay Babu Dudla on Apr 28, 2009 12:59 AM

    Hi ,
    If you want to change the column name, you can put your code following:
    <htmlb:tableViewColumn columnName    = " "
               *title        = " put the cloumn name here"*
               </htmlb:tableViewColumn>
    Please try.
    Any doubt let me know.
    Regards,
    Chris Gu
    Edited by: Gu Chris on Apr 28, 2009 5:26 AM
    Edited by: Gu Chris on Apr 28, 2009 5:26 AM
    Edited by: Gu Chris on Apr 28, 2009 5:27 AM

  • Change the column names programatically

    Hi All,
    is it possible to change the column name in a table programatically?? my req is like this..I ve a table which contains 60 columns. out of these 60 columns 53 columns signifies the 53 weeks of the year. so i ve to display the date in the column headers. How can i achieve this?
    Thanks in advance,
    Sree

    Column prompts can be modified through the OAF Personalization screens. This will ensure you are declaratively setting the values.
    Regards,
    Prabodh.

  • Changing the column names displayed via an ODBC driver

    Hi we are just starting to used Crystal Reports to improve the reporting capabaility of a legacy application, we can access the data fine using an ODBC driver. What we want to do is change the column names that are displayed within Crystal Reports so they are more user friendly and not in techno speak,, so that the users can create their own reports. Do we need to used Business Objects to setup a Universe to do this, is their a simple cheaper method sorry if this post is in the wrong section

    Can you set up "views" in your database? That would probably be the easiest way to do this.
    -Dell
    - A computer only does what you told it to, not what you thought you told it to!</p>

  • Can I change the Column Name without losing data and change the sequence

    Dear Experts,
    I want to change the column name without changing the sequence and dont want lose the data.

    Oracle Version : ?
    Example Based on 10g.
    SQL> conn scott/tiger
    Connected.
    SQL> create table col1 as select * from all_objects where rownum <= 100;
    Table created.
    SQL> alter table col1  add constraints col1_pk_objid primary key(object_id);
    Table altered.
    SQL> desc col1
    Name                                      Null?    Type
    OWNER                                              VARCHAR2(30)
    OBJECT_NAME                                        VARCHAR2(30)
    SUBOBJECT_NAME                                     VARCHAR2(30)
    OBJECT_ID                                 NOT NULL NUMBER
    DATA_OBJECT_ID                                     NUMBER
    OBJECT_TYPE                                        VARCHAR2(19)
    CREATED                                            DATE
    LAST_DDL_TIME                                      DATE
    TIMESTAMP                                          VARCHAR2(19)
    STATUS                                             VARCHAR2(7)
    TEMPORARY                                          VARCHAR2(1)
    GENERATED                                          VARCHAR2(1)
    SECONDARY                                          VARCHAR2(1)
    SQL> alter table col1 rename column object_id to object_no;
    Table altered.
    SQL> desc col1;
    Name                                      Null?    Type
    OWNER                                              VARCHAR2(30)
    OBJECT_NAME                                        VARCHAR2(30)
    SUBOBJECT_NAME                                     VARCHAR2(30)
    OBJECT_NO                                 NOT NULL NUMBER
    DATA_OBJECT_ID                                     NUMBER
    OBJECT_TYPE                                        VARCHAR2(19)
    CREATED                                            DATE
    LAST_DDL_TIME                                      DATE
    TIMESTAMP                                          VARCHAR2(19)
    STATUS                                             VARCHAR2(7)
    TEMPORARY                                          VARCHAR2(1)
    GENERATED                                          VARCHAR2(1)
    SECONDARY                                          VARCHAR2(1)
    SQL> column column_name format a30
      1  select column_name,constraint_name
      2  from user_cons_columns
      3  where table_name = 'COL1'
      4* and owner = 'SCOTT'
    COLUMN_NAME                    CONSTRAINT_NAME
    OBJECT_NO                      COL1_PK_OBJID
    SQL>
    also go through
    http://www.dizwell.com/prod/node/65
    Message was edited by:
    user52

  • Dynamically change the column name....

    Hi,
    I am facing a problem in displaying name of the columns dynamically as a parameter selected from the dashboard prompt.
    I have some facts which contains data according to the selected month (From Prompt).
    As of now the column names are:
    Curr, Next1, Next2, Next3 which displays the data for the months accordingly to the selected month from prompt.
    Data is coming correctly but on the report the column name are displayed as Curr, Next1, Next2 and Next3 which I want to be displayed as the month name for which it contains data.
    How can I do that? I have tried presentation variables to be used in custom heading but that is only as string.
    Thanks in advance !!!
    Regards,
    S Anand
    Edited by: S Anand on Nov 20, 2009 2:29 AM
    Edited by: S Anand on Nov 20, 2009 2:29 AM

    My scenario is little different, let me explain:
    My columns will remain same but values changes (based on column formula) according to the selected prompt value
    If I select 'Oct' from prompt then
    Curr will contain data for 'Oct' only
    Next1 will contain data for 'Nov' only
    Next2 will contain data for 'Dec' only
    Next3 will contain data for 'Jan' of next year only.
    Later if I select 'Jul' from prompt then
    Curr will contain data for 'Jul' only
    Next1 will contain data for 'Aug' only
    Next2 will contain data for 'Sep' only
    Next3 will contain data for 'Oct' only.
    I don't have different columns for each months but the columns are capable to reflect data for any month.
    So, how can I reflect the column name as month name for which that contains data.
    Regards,
    S Anand

  • Changing the Column Name in Criteria is not reflected on the Column Selecto

    When we rename the column name in the Criteria, it is not being reflected on the Column Selector drop down list.

    Since you have to add the columns from the presentation layer to the column selector view, my guess is you would have to rename the columns at the presentation layer to accomplish that.

  • How to change the column name of Data Entry View of CAT2?

    Hi experts,
    The requirement is to change the name of one of the columns in the Time Sheet: Data Entry View appearing on execution of t-code CAT2. What should be the procedure to do the same?

    I came across the thread
    CAT2 Worklist enhancement.
    which aims to do the same. Does this method work? How is the problem mentioned in Step 5 of the final post to be resolved?

  • Changing the Column name of a table horizontally

    Hi ,
    I have a table named emp.
    Empno Sal
    10 1000
    20 2000
    30 3000
    40 4000
    I need the output like
    Empno 10 20 30 40
    sal 1000 2000 3000 4000
    Note: It should work for any table. Also not the column & row mapping which should be synchronised like the original structure.

    I dont want to go for pl/sql . It should work any table.You want Dynamic SQL without using PL/SQL? Tricky. I'm sure there's a possible way using some very complex and convoluted XML functionality of SQL but in reality you are asking for something that isn't natural to SQL queries, especially if you are expecting a dynamic number of columns to be produced for each row of data. SQL expects a table structure, including output formats, to be a defined number of columns with any number of rows, not a defined number of rows with any number of columns.
    Perhaps if you explain why you need this sort of functionality then we may be able to offer a better solution.
    ;)

  • Can the column names be changes dynamically in OBIEE presentation

    Hi,
    Is thr any way through which I can change the column names depending on the value of a column.
    the table structure is
    Plan_name      Character1   Character2    Character3  ....
    so here according to plan_name the meaning of each character column changes. And I want to display each type of meaning on the presentation layer.
    I cannot create aliases as the number of different plan name is 1200.
    Any help will be appreciated.
    Regards,
    Akansh Agarwal

    Hi,
    I haven't tested these options, but you might. Maybe you try to supress the header for your table with data. After that, create a second table, which will be used as the header, and insert the same number of columns as the first table.
    So on the 'header' table, create a conditional style (Criteria, Column Properties, Conditional Formatting), pointing to the values on shown in the first table. (You maybe need the data to be queried in both).
    If this does't work, you can try to adapt the javascript shown in this blog: DELIVER BI OBIEE 11g &amp;amp; 10g , ODI , OBIA: OBIEE Table make a row BOLD with JAVA
    And instead of making the row bold, change the value.
    Hope this helps. Sorry if it does't work.
    Best regards.

  • How to change the attribute name for a relation

    When the Data Modeler engineers a logical model into a relational model it create table columns for the relations. The names of the generated columns are listed in the attributes list in the properties dialog of the relation. The actual name of the attribute gets calculated by the attribute name of the entity which is part of the relation. This is okay, if there is only one relation between two entities. But when there are two relations between two entities the second attribute gets a stupid number suffix. This makes it impossible to give the attribute a useful semantic meaning.
    When I engineer the model into a relational model I can change the column name in the relational model. Changing the column name in the relational model is not perfect but it would be okay for me, if it would not be overwritten during the next engineering run.
    So I have two questions:
    How can I change the attribute name in the attributes section of the properties dialog of a relation? See here for screen shot:
    http://public.ceving.de/2012050300/relationattribute.png
    And if it is not possible:
    How can I preserve any changes on column names in the relational model during a re-engineering run?
    Edited by: 931739 on 03.05.2012 08:07

    Hi,
    I've logged an Enhancement request on this.
    I don't believe it's possible to change it from the Entity or Relationship dialog, as it's not updatable in these dialogs.
    What you can do is change it in the Relational Model, and then reverse engineer the change back to the Logical Model.
    David

  • Changing JTable column names

    I have a JTable where the user can right click on the table header to change what data is displayed. When the user selects different data to display, I would like to change the column name to reflect this. What is the best way to do this?
    TIA
    ZeroFK

    table.getColumnModel().getColumn(???).setHeaderValue(???).

  • Changing Alv Column name

    Hi,
    I have a "viewcontaineruielement" which displays an ALV. Now i want to change the column names.
    Please give an detailed answer.
    Thanks

    Hi Adil
    Ple refer this.
      data:
    lr_alv_usage type ref to if_wd_component_usage,
    lr_if_controller type ref to iwci_salv_wd_table,
    lr_config type ref to cl_salv_wd_config_table,
    lr_column type ref to cl_salv_wd_column,
    lr_header type ref to cl_salv_wd_column_header,
    lr_column_settings type ref to if_salv_wd_column_settings,
    ls_column type salv_wd_s_column_ref,
    lt_columns type salv_wd_t_column_ref,
    Instantiate the ALV Component
    lr_alv_usage = wd_this->wd_cpuse_alv_display( ).
    if lr_alv_usage->has_active_component( ) is initial.
    lr_alv_usage->create_component( ).
    endif.
    Get reference to model
    lr_if_controller = wd_this->wd_cpifc_alv_display( ).
    lr_config = lr_if_controller->get_model( ).
    To get the dropdowns displayed you need to set the table to editable by using below statement
    lr_config->if_salv_wd_table_settings~set_read_only( abap_false ).
    Set the UI elements.
    lr_column_settings ?= lr_config.
    lt_column = lr_column_settings->get_columns( ).
    ********-- Header Settings--*************
      lr_column = lr_column_settings->get_column( 'VBELN' ).
       lr_column->set_position( '1' ).
      lr_header = lr_column->get_header( ).
      lr_column->set_width( '2' ).
    lr_column->Set_width( '2' ).
       lr_header->set_text( 'Invoice No' ).
      lr_header->set_tooltip( 'Invoice No' ).
        lr_header->set_ddic_binding_field( ).

Maybe you are looking for

  • Ical iOS Lion, month preview / change style

    Hi, I am wondering how to display the preview of the months to come in the left side of the new iCal, like it was possible before in weekly view. I really miss this functionality, as I need to have a good idea of the months to come to manage many of

  • Printing Line Items in Script without using driver program

    How to print the line items of a internal table in sap script without using driver program? I am not supposed to edit anything in the driver program. Pls help me to solve this problem...

  • Integrate Exchange 2013 server with 2012R2 Essentials server.

    After navigating to %Program Files%\Windows Server\Bin I try to run the command:- ARRConfig config –cert "path to the certificate file" –hostnames "host names for Exchange Server"–targetserver "server name of Exchange Server" But receive the error:-

  • Batches in goods receipt PO

    Hi, If I want to receive more items on an exisiting batch I get the system message  that the batch already exists. Is it possible to getrid of this message. Thanks Ad

  • Maintaining security information across pages

    Is there an efficient way to maintain the security principal/credential           associated with the JNDI Context across pages within a session? Or is there           some place that describes how the security information is retained/released