Select first n columns

Hi
I need to select first n columns thru a query. i dont know the column names.
Thanks and Regards
Ananth Antony

desc emp
EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
if n=3 means the output should be (i dont know the column name)
EMPNO ENAME JOB
7369 SMITH CLERK
7499 ALLEN SALESMAN
7521 WARD SALESMAN
7566 JONES MANAGER
7654 MARTIN SALESMAN
7698 BLAKE MANAGER
7782 CLARK MANAGER
7788 SCOTT ANALYST
7839 KING PRESIDENT
7844 TURNER SALESMAN
7876 ADAMS CLERK
EMPNO ENAME JOB
7900 JAMES CLERK
7902 FORD ANALYST
7934 MILLER CLERK
for emp Table.
Thanks
Ananth Antony

Similar Messages

  • On SSRS Export or Print, Select the first 9 columns out of 15 columns

    Hello Every1,
    My Greetings for the day!!!
    I am Hiren Parikh from India.
    I am developing a SSRS report (Tablix) which has 15 columns. While developing the report, I have come a crossed a strange requirement.
    When the reports gets loaded in SSRS Preview or in Sharepoint, it should display all the 15 columns.
    However, if the user exports the same report or print the report in that case only the first 9 (columns 1 to 9)should come and the remaining 6 (columns 10 to 15) should not come in the print or export.
    I request you all to suggest me.
    Thanks in advance.
    Regards,
    Hiren Parikh.
    Hiren Parikh

    Hi Hiren Parikh,
    Per my understanding that you want to hide the remaining 6 columns when print or export the report but display all the column when view in Sharepoint, right?
    I have tested on my local environment and if your SQL Server version is 2008 R2 or higher, you can take reference as the method below:
    This method is use the expression to show/hide the 6 columns in the report, when you print/ export the report it will hide, only when you preview in the designer or view the report in the server you can see all the columns
    Details information below for your reference:
    Check the entire column and right click the column to select the "Column Visibility"
    Check the "Visibility" on the left pane and check the "Show or hide base on an Expression"
    Expression:
    =iif(Globals!RenderFormat.IsInteractive,False,True)
    Repeat the step1 and step2 to hide the other columns.
    If your version is SSRS 2008 and older, you can create a Parameter name 'Display or Print' and can give 2 values one Display and another Print.
    Create two tablix: one have 15 columns (Tablix1)and another 9 columns (Tablix2)and when choose "Display" show the tablix1 and hide the tablix2 and when select the "Print" hide the tablix1 and show the tablix2.
    If you have any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Count first two columns

    Hello,
    I have a count requirement that i havent been able to solve by searching sdn.  Maybe someone can help.
    I have a query built on a multiprovider that points to two basic cubes.  The basic cubes do not contain a count key figure.  The first two columns of my query are characteristics.  My requirement is to count the occurences of the combination of the first two column (characteristics).  I am looking for a way to do this in the query so i do not have to reload the cubes as they have large volumes of data.  All the suggestions i have been able to find on sdn seem to be only for counting a single characteristic.  Is there a way to count the combination of two?
    Regards,
    TMS

    Hi Create a count using the formula or calculated ket figure for the count unique id like client id for your infocube.
    so you will have a count for each row now. place this count object in your column.
    now select the two char or the group whatever you want a count in your row.
    select query properties and select the display tab and make sure the option - hide repeated key values is selected (normally by default it is selected). Then select each of the char in rows and in free char and set the option under display tab result rows - always suppress.
    Execute the query now. you will get the list of char and their count. sort the count by descending to get the most duplicate entries by their highest number on top in the count coulmn.
    you can also ignore the rows which donot have a duplicate i.e count more than 1 by creating a new condintion on the count key figure > 1 and restricting the condition  by only the group of char you have given in the column. so that you can also do a drill down by free char in your query and it will only show the duplicates group.
    Hope it helps.
    regards,
    Siva

  • BEx analyzer 7.x: How to determine first data column in result table?

    Hi,
    we are upgrading to 2004s where the SAPBEXqueries Sheet is not used anymore. Instead there is BExRepositorySheet. Is there a way to determine first data column in result table?
    Regards, Josko.

    hi dinesh......
    please use  'INTO TABLE' instead of  ' INTO CORRESPONDING FIELDS OF TABLE '.  and use ' FOR ALL ENTRIES '............based on relavence ....coz when I set break point  over the select queries it took me long time to execute .......
    becoz u didnt used the for all entries  in select query ............ u r read statement
    READ TABLE I_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_KNVV-KUNNR.  ..... 
    it is reading wrong kunnr value .............even it took long time to execute ......
    use sort where ever required...
    use for all entries .......and check weather the table initial or not......
    use sy-subrc check where ever reqired ..............

  • Select row and column from header in jtable

    hello i have a problem to select row and column from header in jtable..
    can somebody give me an idea on how to write the program on it.

    Hi Vicky Liu,
    Thank you for your reply. I'm sorry for not clear question.
    Answer for your question:
    1. First value of Open is item fiels in Dataset2 and this value only for first month (january). But for other month Open value get from Close in previous month.
    * I have 2 Dataset , Dataset1 is all data for show in my report. Dataset2 is only first Open for first month
    2. the picture for detail of my report
    Detail for Red number:
    1. tb_Open -> tb_Close in previous month but first month from item field in Dataset2
    espression =FormatNumber(Code.GetOpening(Fields!month.Value,First(Fields!open.Value, "Dataset2")))
    2. tb_TOTAL1 group on item_part = 1
    expression =FormatNumber(Sum(CDbl(Fields!budget.Value)))
    3. tb_TOTAL2 group on item_part = 3 or item_part = 4
    expression =FormatNumber(Sum(CDbl(Fields!budget.Value)) + ReportItems!tb_TOTAL1.Value )
    4. tb_TOTAL3 group on item_part = 2
    expression =FormatNumber(Sum(CDbl(Fields!budget.Value)) - ReportItems!tb_TOTAL2 .Value)
    5. tb_Close -> calculate from tb_TOTAL3 - tb_Open
    expression =FormatNumber(Code.GetClosing(ReportItems!tb_TOTAL3.Value,ReportItems!tb_Open.Value))
    I want to calculate the value of tb_Open and tb_Close. I try to use custom code for calculate them. tb_close is correct but tb_Open is not correct that show value = 0 .
    My custom code:
    Dim Shared prev_close As Double
    Dim Shared now_close As Double
    Dim Shared now_open As Double
    Public Function GetClosing(TOTAL3 as Double,NowOpening as Double)
        now_close = TOTAL3 + NowOpening
        prev_close = now_close
        Return now_close
    End Function
    Public Function GetOpening(Month as String,NowOpen as Double)
        If Month = "1" Then
            now_open = NowOpen
        Else    
            now_open = prev_close
        End If
        Return now_open
    End Function
    Thanks alot for your help!
    Regards
    Panda A

  • Selective reordering of columns in a Jtable

    Hi
    I have this problem where I need to allow the first 8 columns to be reordered but not the remaining columns in a Jtable.
    I have tried a few approaches by adding listeners to the jtable header and identifying the column which is clicked for reordering and accordingly setting the rearrange policy / feature of the jtable to true/false.
    This works fine in almost all scenarios except for one where the user selects a column which can be reordered and drags it to a position beyond the allowed 8 columns, and now that column is frozen since it is beyond the permissible index of 8.
    I was wondering if there was a 'cleaner'/ better way to go about implementing this.

    Thanks for the link...
    I went through it but seems like a big change for the functionality I want to achieve.
    I am thinking about allowing the user to reorder the column and then if he has chosen an invalid column (one which cannot be rearranged) just undo that action using the moveColumn method.
    I tried overriding the columMoved method to inform me about a column reorder evernt but that method keeps getting fired while the user is rearranging.
    Is there anyway to get a notification once the user is done rearranging the column.
    Thanks

  • Object browser displays only First 31 columns in Data section of a table.

    I need to download data from a table which has almost 60 columns. When i selected table from object browser and clicked on data section of this table, only first 31 columns are displayed and when clicked on download, only the data for those 31 columns is displayed. How to download data of all colums of this table

    Hello Jim
    I have the same problem, but my limit is 21 columns. I think the limit is caused by the DataReader SchemaTable. Check the following value:
    IDataReader.GetSchemaTable().Columns.Count
    Columns in the SchemaTable are Metadata (ColumnName, ColumnSize, DataType, AllowDBNull...), the columns that are selected with the DataReader are stored in the SchemaTable Rows Property.
    For Oracle and SQLServer i used this workaround:
    DataTable dataTable = IDataReader.GetSchemaTable();
    while (dataTable.Columns.Count < dataTable.Rows.Count)
        dataTable.Columns.Add("Dummy" + dataTable.Columns.Count.ToString(), typeof(bool));
    I think developpers of CR use the Columns.Count instead of Rows.Count property when getting the data out of the DataReader.
    Regards,
    Walter

  • Select * first fetches 5th row... Why?

    Dear Experts,
    I developed a z-table, with fields
    rno(6) type n,
    name(20) type c
    and then created ten entries from rno 1 to 10.
    and a z-report which uses this table
    select * from ztable.
    first it displays 5th row and then 1 to 4 and then 6 to 10.
    Can help me why it displays 5th row first?
    Thanks in Adance

    SAP Help
    If you do not use the ORDER BY clause, the sequence of the lines in the selection is indeterminate, and can vary each time the SELECT statement is executed.
    You can sort the selection by any column (not necessarily those of the primary key), and specify the columns either statically or dynamically.

  • How to select a specific column in a bean method?

    Hey everyone,
    I'm trying to select a specific column in my adf table so i can hightlight the ones i can after, with a method bean that does a match from another table. I'm using JDeveloper 12.1.2.0.0.
    Here's my table at the moment (its a static list that Timo and Alejandro helped me create, thanks to them again!):
    <af:table value="#{bindings.Anos1.collectionModel}" var="row"
                                                              rows="#{bindings.Anos1.rangeSize}"
                                                              emptyText="#{bindings.Anos1.viewable ? 'No data to display.' : 'Access Denied.'}"
                                                              rowBandingInterval="0" fetchSize="#{bindings.Anos1.rangeSize}"
                                                              filterModel="#{bindings.Anos1Query.queryDescriptor}"
                                                              queryListener="#{bindings.Anos1Query.processQuery}"
                                                              filterVisible="false" varStatus="vs" id="t5"
                                                              styleClass="AFStretchWidth" columnSelection="multiple"
                                                              inlineStyle="max-width:100%;" columnStretching="multiple"
                                                              columnSelectionListener="#{ControlBean.onAnoColumnSelect}"
                                                              disableColumnReordering="true"
                                                              binding="#{ControlBean.dimAnos}">
                                                        <af:column sortProperty="#{bindings.Anos1.hints.A2011.name}"
                                                                   filterable="true" sortable="false"
                                                                   headerText="2011"
                                                                   id="c54" width="16%">
                                                            <af:outputText value="#{row.A2011}"
                                                                           shortDesc="#{bindings.Anos1.hints.A2011.tooltip}"
                                                                           id="ot54">
                                                                <af:convertNumber groupingUsed="false"
                                                                                  pattern="#{bindings.Anos1.hints.A2011.format}"/>
                                                            </af:outputText>
                                                        </af:column>
                                                        <af:column sortProperty="#{bindings.Anos1.hints.A2012.name}"
                                                                   filterable="true" sortable="false"
                                                                   headerText="2012"
                                                                   id="c55" width="16%">
                                                            <af:outputText value="#{row.A2012}"
                                                                           shortDesc="#{bindings.Anos1.hints.A2012.tooltip}"
                                                                           id="ot55">
                                                                <af:convertNumber groupingUsed="false"
                                                                                  pattern="#{bindings.Anos1.hints.A2012.format}"/>
                                                            </af:outputText>
                                                        </af:column>
                                                        <af:column sortProperty="#{bindings.Anos1.hints.A2013.name}"
                                                                   filterable="true" sortable="false"
                                                                   headerText="2013"
                                                                   id="c56" width="16%">
                                                            <af:outputText value="#{row.A2013}"
                                                                           shortDesc="#{bindings.Anos1.hints.A2013.tooltip}"
                                                                           id="ot56">
                                                                <af:convertNumber groupingUsed="false"
                                                                                  pattern="#{bindings.Anos1.hints.A2013.format}"/>
                                                            </af:outputText>
                                                        </af:column>
                                                    </af:table>
    I've deleted some of the columns because they are all equal and by doing so, you have less problems in reading it.
    In my method i have a matchEm but i'm trying to select a column by using this line:
            dimAnos.setColumnSelection("A2012");
    dimAnos is the binding for my table Anos (Years in Portuguese). I even tried another values fro the columnSelection but i couldn't make it selected. Am i doing anything wrong?
    Please help me or give me an idea of how can i do this.
    Regards,
    Frederico.

    Hi Frederico,
    The method setColumnSelection is meant to set whether your table supports column selection or not. It doesn't select the column. In order to select the column, you need to set the column attribute Selected to true. So I don't know if its an option for you but you can create a binding to all the columns you have in you bean, and then call the method A2012.setSelected(true), and then add a partial target to the table to re render it and show the selected column.
    Hope this helps

  • Export option in ALV report downloades first two columns blank

    Hi ,
    Before posting this query I searched the solution in SDN but I did't find the solution.
    My problem is  After displaying report in ALV format ,if I press Export --> Local file --->spreadsheet ;  file will downloaded to excel sheet but first two columns(only heading no data ) will be blank  and next two columns with proper data.
    I checked field catalog defination it seems to be ok,  any other mistake ?
    Please suggest.
    Narayan

    Hi
    It's the option you have in the path System->List->Save->Local file
    I means it's the standard option to export an abap list into a local file, so you should try this path too and check if the resul it's the same
    I think you should choose  Export --->spreadsheet: here before saving the file an excel document will be open
    Max

  • How to select even the column names of a table?

    Hello All,
    Is there a way to select even the column names of a table in the select statement?
    My select from a table (say X) is in a SQL* Plus script that gets invoked by application tier and displays data in the application tier window. User's can then copy the data into a spreadsheet and do their processing. However, I need to give them the column names too along with the data.
    Thanks,
    Chiru

    If there is a middle tier that is selecting and
    displaying the data, and that's what the users are
    copying from, the middle tier would have to address
    its presentation of the data to allow users to
    include column names. If this is a common task, the
    application should probably be modified to give users
    the option of downloading the data in a spreadsheet
    directly rather than forcing them to copy and paste
    data.Thanks for the reply.
    The users don't have to copy paste. The application tier has an options in the "Tools" menu item which allows them to copy the entire output to a file (in my case a txt file which is a pipe delimited). Then they have to do text to columns to get the data into each column of the spreadsheet. I could have directly called the stored procedures from the application tier and created ".csv" files and FTP'd them to the user's folders. However, I am having to go this round about because, I am not getting enough support from the LAN team in FTP'ing etc.
    OK I'll think of another workaround.
    Thanks,
    Chiru

  • The sheet I am working on has lost the ability for me to scroll to the first few columns. I can't see the columns but I can cut and paste them so I know they are still there. Has this happened to others

    The sheet I am working on has lost the ability for me to scroll to the first few columns. I can't see the columns A & B but if I cut and paste the table to a new sheet, the columns I am missing will travel to the new sheet.  I have charts and other stuff related the the original table so I need to figure out why I can only see from column C  forward.  I tried to "UNHIDE" the columns but the function doesn't seem to recognise that there are columns missing. Has this happened to others and how did you fix it?

    I've seen it happen before, or at least it sounds something like what I've seen before. The table somehow gets into the margins of the page and the app doesn't know how to deal with it. Go into Print View and try moving the table away from the left side ofthe page. You might have to change content size or resize the table to get it to correct (then put you can put them back the way you like).

  • I'm trying to open a 900kb Word doc (240pages) in Pages but get this error message:  Import Warning - A table was too big. Only the first 40 columns and 1,000 rows were imported.

    I'm trying to open a 900kb Word doc (240pages) in Pages but get this error message:  Import Warning - A table was too big. Only the first 40 columns and 1,000 rows were imported.

    Julian,
    Pages simply won't support a table with that many rows. If you need that many, you must use another application.
    Perhaps the originator could use a tabbed list rather than a table. That's the only way you will be able to contain a list that long in Pages. You can do the conversion yourself if you open the Word document in LibreOffice, Copy the Table, Paste the Table into Numbers, Export the Numbers doc to CSV, and import to Pages. In Pages Find and Replace the Commas with Tabs.
    There are probably other ways, but that's what comes to mind here.
    Jerry

  • How do I select a date column and display the millesecond along with it.

    I am trying to select a date column from database and want to
    display millesecond with it. How do I do this. I am aware of
    the "alter session set NLS_DATE_FORMAT = 'MM/DD/YY HH:MI:SS'"
    command. However, I do not know how to display this with the
    millesecond.
    Thanks for all the help.

    Example:
    SQL> CREATE OR REPLACE JAVA SOURCE
      2  NAMED "MyTimestamp"
      3  AS
      4  import java.lang.String;
      5  import java.sql.Timestamp;
      6 
      7  public class MyTimestamp
      8  {
      9  public static String getTimestamp()
    10   {
    11   return (new
    12   Timestamp(System.currentTimeMillis())).toString();
    13   }
    14   };
    15  /
    Java created.
    SQL> CREATE OR REPLACE FUNCTION my_timestamp
      2    RETURN VARCHAR2
      3  AS LANGUAGE JAVA
      4  NAME 'MyTimestamp.getTimestamp() return java.lang.String';
      5  /
    Function created.
    SQL> CREATE TABLE test_time
      2    (date_col VARCHAR2 (23))
      3  /
    Table created.
    SQL> INSERT INTO test_time (date_col)
      2  SELECT my_timestamp
      3  FROM   dual
      4  /
    1 row created.
    SQL> SELECT date_col
      2  FROM   test_time
      3  /
    DATE_COL
    2001-11-02 14:58:51.766

  • Make Select rows and columns as read only in Table Control

    Hi All,
    I would like to know how to make certain cells in a Table Control as display only.
    Table control should look like-(Those in bold are read only or in display mode)
    <b>Name1            Idno1 </b>         Address1
    <b>Name2            Idno2</b>          Address2
    <b>Name3            Idno3  </b>        Address3
    <b>Name4            Idno4</b>          Address4
    (Blank row to enter name idno and address)
    (Blank row to enter name idno and address)
    (Blank row to enter name idno and address)
    My table control should display all the above fields the way it is above of which first two colums and 4 rows should be read only,and the rest of the empty rows in the TC should be in change mode.i.e it must have provision to add new rows but not change the first two columns of existing rows.
    In short I am looking at solution to hide particular no of rows and columns and <b>not the entire column.</b>

    In the PBO of the table control loop. just write these statements
    NAME and IDNO considering the fields on the screen.
    and WA_TAB is the table work area being passed to the table control to display the rows.
    if not WA_TAB-NAME is initial and not WA_TAB-IDNO is initial.
    loop at screen.
    if screen-name = 'NAME' or
       screen-name = 'IDNO'.
    screen-input = <b>0</b>.
    modify screen.
    endif.
    endloop.
    endif.
    which means that the fields are disabled only if NAME and IDNO are not initial.
    Regards
    - Gopi

Maybe you are looking for

  • Compressor will not launch

    I have FCP 5.1.4 installed, along with Compressor 2.1 (as part of FCP Studio 1). I've been searching in this forum and elsewhere on the web, and it appears that many people are having a similar problem: the Compressor application will simply not laun

  • Beginner ABAPer asking Doubts in BDC

    Hi Guyz, I am a beginner in ABAP. Here i am sending some doubts on BDC . Any Kind of help will be highly Appreciated. Thanks, SAM 1>How do we handle all the scrolling funcions(page ups, page downs atc), and values entered into table controls in BDC ?

  • Macbook Air 4.2 : Synaptics refuses to load

    I can't quite seem to get my synaptics to load as a device driver for my touchpad. Each time, it unloads itself with the following errors : [ 2708.893] (--) Apple Inc. Apple Internal Keyboard / Trackpad: no supported touchpad found [ 2708.893] (EE) A

  • How do I convert a Expression Web template into Dreamweaver CC?

    Just got the Adobe CC subscription they said I could convert an Expression Web site template to Dreamweaver?  It has a file master.dwt that has the common header, footer and menu

  • HT4352 Where do I find the advanced key for home sharing

    Where would I find the Advanced key for Apple home sharing