How to do Alias of multiple columns?

Hello Pl/SQL gurus -
I have a sql query as following -
SELECT A as AA , B as BB, C as CC, D as DD, E as EE, F as FF
FROM
TABLE A
TABLE B
TABLE C
WHERE.....
Now i want to give some Alias say AAA to already aliased column AA,BB and BBB to CC,DD and CCC to EE and FF and want to print the values only at the level of AA,BB,CC,DD etc....
so now this will have two layer of hierarchy AAA, BBB, CCC and under that AA,BB, CC,DD and EE,FF respectively, where higher layer (AAA,BBB,CCC is just a representation) and AA,BB,CC,DD etc will have the actual values.
Something like -
AAA     ||     BBB      ||          CCC
AA     BB     CC     DD          EE     FF
how can i do it?
Kindly help me

user555994 wrote:
I agree Karthick that SQL should not do it as it is the presentation layer which is responsible for doing so......:)
But in case if try to achieve it using SQL then how can i do it...
as want to understand this and learn a new thing as well , as this will help in making me expose to new thing , as i have learned a lot with you guidance of lots of different experts/seniors and i am amazed with the knowledge bank available on this form.....
Thanks in advance for your help and timeThis is the best i could think of. But would never do it.
SQL> create table t( a integer, b integer, c integer, d integer)
  2  /
Table created.
SQL> insert into t (a, b, c, d) values (1, 1, 1, 1)
  2  /
1 row created.
SQL> insert into t (a, b, c, d) values (2, 2, 2, 2)
  2  /
1 row created.
SQL> select * from t
  2  /
         A          B          C          D
         1          1          1          1
         2          2          2          2
SQL> create or replace type col_obj as object(a integer, b integer)
  2  /
Type created.
SQL> create or replace type col_obj1 as object(c integer, d integer)
  2  /
Type created.
SQL> select col_obj (a, b) aa, col_obj1(c, d) bb
  2    from t
  3  /
AA(A, B)                       BB(C, D)
COL_OBJ(1, 1)                  COL_OBJ1(1, 1)
COL_OBJ(2, 2)                  COL_OBJ1(2, 2)
SQL>

Similar Messages

  • How do you count the multiple columns of a field in a table

    How do you count the multiple columns of a field in a table

    Hi,
    4396bf34-e890-4202-a6b0-4e08c9ff0e89 wrote:
    How do you count the multiple columns of a field in a table
    Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    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
    "Field" isn't a standard database term.  Some people say "field" when they mean "column", but I don't think that's what you mean ("How do you count the multiple columns of a column ..").  Do you want to know how many times a column is used (as opposed to NULL), or the number of different values in a column?  You really need to show what you want.

  • How to filter rows where multiple columns meet criteria, ignoring rows where only some columns meet criteria

    Hi All,
    Question: How do I filter rows out of a query where multiple columns are equal to a single question mark character?
    Background: I'm using SQL 2008 R2.  Furthermore, the part of my brain that helps me create less-than-simple queries hasn't been working for the last 4 days, apparently, and now I need help.
    We have about 4,000 rows in a table.  This data set was generated from an exported report, and many of the rows in the detail table were not actual data rows but were simply "header" rows.  For those table rows, most of the columns have
    a single question mark as the value.
    Some of the detail rows have one or more question mark values, too, so it's important that these rows don't get filtered out.
    When I include criteria like "WHERE col1 <> '?' AND col2 <> '?' AND col3 <> '?' AND col4 <> '?'", all rows with a question mark value for even a single one of those columns get filtered out.  How do I filter out rows
    where all columns 1-4 contain a question mark value?
    Thanks for your help,
    Eric

    I just tried to create to create a scenario for you. Please see ig you're looking for something like this.
    Create table test_Question_mark
    RecordID INT identity(1,1),
    Col1 varchar(10),
    Col2 varchar(10),
    Col3 varchar(10),
    Col4 varchar(10),
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('?','?','?','?')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('?','??','?','?')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('?','??','??','?')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('??','??','??','??')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('?','?','?','?')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('??','test ??','??','??')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('??','test ?','??','??')
    --drop table test_Questio_mark
    select * from test_Question_mark
    select * from test_Question_mark 
    WHERE 
    (CHARINDEX('?', Col1,1) > 0 AND CHARINDEX('?', Col1, CHARINDEX('?', Col1,1)+1) = 0) AND 
    (CHARINDEX('?', Col2) > 0 AND CHARINDEX('?', Col2, CHARINDEX('?', Col2,1)+1) = 0) AND 
    (CHARINDEX('?', Col3,1) > 0 AND CHARINDEX('?', Col3, CHARINDEX('?', Col3,1)+1) = 0) AND 
    (CHARINDEX('?', Col4,1) > 0 AND CHARINDEX('?', Col4, CHARINDEX('?', Col4,1)+1) = 0) 
    --drop table test_Questio_mark
    I hope above solution will help.
    Thanks!
    Ashish.

  • Af:treeTable: how build tree that displays multiple columns?

    I only find a default single column behavior in the dev guide regarding af:treetable. Perhaps some of you might have already tried this out, I'm trying to build a master detail using a treetable with multiple columns. After establishing the ViewLink association and dragging the Master View Object onto the cavas, the default generated code looks like:
    <af:treeTable ...
    <f:facet name="nodeStamp">
    <af:column binding="#{backing_tree.column1}" id="column1"
    sortable="false" headerText="">
    <af:outputText value="#{node}"
    binding="#{backing_tree.outputText1}"
    id="outputText1"/>
    </af:column>
    </f:facet>
    </af:treeTable>
    This renderes the entire tree in one column, but my detail ViewObject contains multiple attributes and I would like seperate columns to display those values. I'm not sure how to extract the "#{node}" EL to output the detail or child ViewObject's values in seperate af:column. Can someone advise? Thank you.
    Z

    Luis, thanks for the suggestion. I did get the header labels to show, however, the values are still not being printed correctly. I have department as the Master or parent node and employee as the Detail or child node. Here is what I have
    <af:treeTable value="#{bindings.DeptView1.treeModel}" var="node"
    binding="#{backing_treeTest.treeTable1}" id="treeTable1"
    rowsByDepth="0 0">
    <f:facet name="nodeStamp">
    <af:column binding="#{backing_treeTest.column1}" id="column1">
    <f:facet name="header">
    <af:outputText value="Department Name"/>
    </f:facet>
    <af:outputText value="#{node.Dname}"
    binding="#{backing_treeTest.outputText1}"
    id="outputText1"/>
    </af:column>
    </f:facet>
    <f:facet name="pathStamp">
    <af:outputText value="#{node.Dname}"
    binding="#{backing_treeTest.outputText2}"
    id="outputText2"/>
    </f:facet>
    <af:column>
    <f:facet name="header">
    <af:outputText value="Employee Name"/>
    </f:facet>
    <af:outputText value="#{node.Ename}"
    binding="#{backing_treeTest.outputText3}"
    id="outputText3"/>
    </af:column>
    </af:treeTable>
    The Tree Table looks Like:
    Department Name | Employee Name
    - Accounting
    Thanks in advance,
    Z

  • How to transpose rows into multiple columns using pivot table

    I have 1 row containing 12 columns with value "JAN", "FEB", "MAR", "J-1","F-1","M-1","J-2","F-2","M-2","J-3","F-3","M-3"
    I want to display as
    JAN J-1 F-1 M-1
    FEB J-2 F-2 M-2
    MAR J-3 F-3 M-3
    How do I achieve the above?

    Today you have only 3 months JAN, FEB, MAR. Is it always the same number of columns. What if there are more months added to this row?
    Is your data really coming from relational source or some sort of text file?
    There is a better way to do this in narrative view using HTML if your requirement is just to show them in multiple rows and do some calculations.
    Go to Narrative View;
    In prefix, use <html> <table>
    In 'Narrative' text box add something like this
    <tr> <td> @1 </td> <td> @4 </td> <td> @7 </td> </tr>
    <tr> <td> @2 </td> <td> @5 </td> <td> @8 </td> </tr>
    <tr> <td> @3 </td> <td> @6 </td> <td> @9 </td> </tr>
    In Suffix, use </table> </html>
    You can also add simple calculations like sum etc at the very bottom of these rows as grand totals.
    kris

  • How to insert signals into multiple columns in db, dbtoolset

    I have  a labVIEW program that is currenly simulating voltage and a current signal using the DAQ Assistant. I'm using the database connectivity toolset. I am currently able to insert one signal into the database converted to a float(I can insert both into the same column as bianary but it needs to be stored as a usable format and in seperate columns.)
    The problem I am having is at the DB Tools Insert Data block. I have the connection, dbTable, error code, and create table boolean being passed into it. Where I am a little lost is how to set the columns I want to store the multiple signals into.
    If someone could break that part down for me that would be great. In short, I want to store voltage(channel0) and current(channel1) from the DAQ Assistant into their own respective columns in the db.

    As I have often pointed out, the easiest solution to this situation is to dump the Database Connectivity Toolkit. Check out this thread and follow the references in it. If the DCT weren't in the way what you are wanting to do would be very easy.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to use a USER_DATASTORE to index multiple columns in different tables

    I would appreciate if somebody can give an example or point to links with examples on how to use USER_DATASTORE on multiple columns in different tables. THe Oracle Text documentation only shows multiple columns in the same table.
    Thanks in advance.

    I am not sure why your getting the wrong results but you should seriously reconsider the approach your are taking. Using functions like this is very ineffecient and should be avoided at all cost.

  • Multiple Column text field in Static PDF form

    Okay, I'm pulling my hair out here. I am filling a .pdf form with itextsharp using powershell scripts. All this part of the issue is working fine.
    My problem is that I have the following data:
    A3015400R-2,A3015318R-1,A3015318R-2,A3015336R-1,A3015423R-1,A3015423R-2,A3015486R-1,A30153 06R-1,A3015240R-1,A3015102R-1,A3015333R-1,A3015120R-1,A3015158R-1,A3015333R-1,A3015400R-3, A3015400R-6,A3015400R-7,A3015234R-1,A3015234R-2,A3015400R-9,A3015306R-5,A3015311R-1,A30154 00R-2,A3015318R-1,A3015318R-2,A3015336R-1,A3015423R-1,A3015423R-2,A3015486R-1,A3015306R-1, A3015240R-1,A3015102R-1,A3015333R-1,A3015120R-1,A3015158R-1,A3015333R-1,A3015400R-3,A30154 00R-6,A3015400R-7,A3015234R-1,A3015234R-2,A3015400R-9,A3015306R-5,A3015311R-1
    That I would like to be displayed in columns across the page within one text field. So that the text field would look like this (approximately):
    A3015400R-2
    A3015318R-1
    A3015318R-2
    A3015336R-1
    A3015423R-1
    A3015423R-2
    A3015486R-1
    A3015306R-1
    A3015240R-1
    A3015102R-1
    A3015333R-1
    A3015120R-1
    I have the data sorted before I populate, so they go in numerical order, and i would like the be able to read them from top to bottom, left to right.
    I just can't figure out how to either:
    a) add multiple columns like I add multiple lines inside a text field
    or
    b) have multiple text fields linked together to thread the text input from fieldA to fieldB
    Any help would be much appreciated.
    edit: The data is actually in this format:
    A3015400R-2
    A3015318R-1
    A3015318R-2
    A3015336R-1
    A3015423R-1
    A3015423R-2
    A3015486R-1
    A3015306R-1
    A3015240R-1
    A3015102R-1
    A3015333R-1
    A3015120R-1
    A3015158R-1
    A3015333R-1
    A3015400R-3
    A3015400R-6
    A3015400R-7
    A3015234R-1
    A3015234R-2
    A3015400R-9
    A3015306R-5
    A3015311R-1
    A3015400R-2
    A3015318R-1
    A3015318R-2
    A3015336R-1
    A3015423R-1
    A3015423R-2
    A3015486R-1
    A3015306R-1
    A3015240R-1
    A3015102R-1
    A3015333R-1
    A3015120R-1
    A3015158R-1
    A3015333R-1
    A3015400R-3
    A3015400R-6
    A3015400R-7
    A3015234R-1
    A3015234R-2
    A3015400R-9
    A3015306R-5
    A3015311R-1
    Message was edited by: zombiejellyfish81

    Did you ever find any solutions to this problem?

  • Multiple Column in JLIst

    Hi friend,
    Please could u tell me how can i make a multiple Column in a JList without using JTable. It would be better if u send me a complete code for that.
    Thanks u very much in Advance.
    Khaled Mahmud

    First of all I would like to thank u for reply.
    I have searched through the Forums but I could not get any solution.
    Actually, I have a code for Multi Column JList but that was made up using JTable.
    But I want a Multi Column JList which is made up without using JTable.

  • How to link Excel Chart with multiple columns dynamically?

    Hi all,
    I have one problem. I have an excel chart which has to read data from multiple columns for it's X-axis values (time stamps) and the same number of values for it's Y-axis from multiple columns. See figure attached.
    Now, you can do this by manually assigning values by holding control key to tell the chart that data from many columns is continued from the first column. i.e, a long data is distributed along may columns. This is done very easily manually.
    Now, how to do it at runtime through LabVIEW 8.0?
    Although, I have done it through labview when there where only two columns, A and B streching up to any length. But, now to save space we are dumping into many columns in the same page and want the chart plot that data as we dump it. 
    It is tough since I don't know how to assign SourceData of the chart through labview.
    I have attached chart's SourceData picture.
    Hope you all can solve my problem.
    The Y-axis values are: =(good!$B$30:$B$70,good!$D$30:$D$70,good!$F$30:$F$70,good!$H$30:$H$70,good!$B$71:$B$140,good!$D$71:$D$140,good!$F$71:$F$140,good!$H$71:$H$140,good!$B$141:$B$189)
    good is the name of the file.
    The X- axis values are: =(good!$A$30:$A$70,good!$C$30:$C$70,good!$E$30:$E$70,good!$G$30:$G$70,good!$A$71:$A$140,good!$C$71:$C$140,good!$E$71:$E$140,good!$G$71:$G$140,good!$A$141:$A$189)
    See the columns vary from A to F.
    I have still not got what I love.....
    Attachments:
    ExcelChart.JPG ‏113 KB
    SourceData.JPG ‏34 KB
    XY values.JPG ‏36 KB

    Ok i solved the excel chart problem. Here is the figure showing my victory! But offcourse with NI forum help.
    Message Edited by Halemani on 09-19-2008 06:33 AM
    I have still not got what I love.....
    Attachments:
    Chart_XValues_Values.JPG ‏36 KB

  • How do i print multiple columns on 1 page in numbers

    I think I am over thinking this but I have confused myself. I am using Numbers to create a spreadsheet of family names with their corresponding number. I would like to print multiple columns of names on one page to save paper but I can't figure how to do it. Will someone please help me???

    Hi BestMommy,
    Here is one way. Don't mess with your database. Create a new table for printing.
    Database with a Header Row (named Table 1 as an example) might look like this:
    Name
    1
    Name 1
    2
    Name 2
    3
    Name 3
    4
    Name 4
    5
    Name 5
    6
    Name 6
    7
    Name 7
    8
    Name 8
    9
    Name 9
    10
    Name 10
    11
    Name 11
    12
    Name 12
    13
    Name 13
    14
    Name 14
    15
    Name 15
    New table for printing:
    Name
    Name
    1
    Name 1
    8
    Name 8
    2
    Name 2
    9
    Name 9
    3
    Name 3
    10
    Name 10
    4
    Name 4
    11
    Name 11
    5
    Name 5
    12
    Name 12
    6
    Name 6
    13
    Name 13
    7
    Name 7
    14
    Name 14
    Formula in A2
    =Table 1::A2
    Formula in B2
    =Table 1::B2
    Formula in C2
    =Table 1::A9
    Formula in D2
    =Table 1::B9
    So it loops back from the bottom of a page to start a new column.
    I made this example small for the pics, but obviously you could have more rows and columns per page.
    Having created your table for printing, select it, Cut, add a new sheet and Paste. Print just that sheet.
    Have a look at 'More Like This' at the bottom of this page. Trying to format page to print table in two columns Jerry suggests using Pages instead of Numbers.
    Regards,
    Ian.
    Edit: Having created your table for printing, select it, Cut, add a new sheet and Paste. Print just that sheet. Ian.

  • How do I create multiple columns with bullets in pages

    I'm trying to figure out how to create multiple columns within a document in which I bullet information...

    At the point you wish to change to two columns, Insert > Columns and then in the Layout Inspector, select the number of columns. After the insertion point, you will also need to insert another Column Change to return the following paragraphs to single column.
    Then Select the text to be bulleted and in the Text Inspector > List tab select the type of bullets.
    Note: This creates two columns that flow together. This can be tricky if you add any text later.
    If you wish to ensure alignment, create a two column text table and remove the lines with the Graphic Inspector > Lines > No Lines option and insert your text in each column and apply the bullets as above.
    This will create a text box - you then need to ensure it moves with the text by electing "Object Moves With Text" in the Wrpa Inspector.
    Message was edited by: bwfromspring hill

  • How to calculate the individual sums of multiple columns in a single query

    Hello,
    Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
    Will appreciate any help or suggestion.
    Thanks

    user13667036 wrote:
    Hello,
    Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
    Will appreciate any help or suggestion.
    ThanksLooks like you want a simple group by.
    select
              yr
         ,      mnth
         ,      region
         ,     sum(handled_package)
         ,     sum(expected_missing_package)
         ,     sum(actual_missing_package)
    from test
    group by
         yr, mnth, region
    order by      
         yr, mnth, region;I wouldn't recommend storing your data for year / month in 2 columns like that unless you have a really good reason. I would store it as a date column and add a check constraint to ensure that the date is always the first of the month, then format it out as you wish to the client.
    CREATE TABLE test
         year_month                              date,
        Region                     VARCHAR2(50),
        CITY                       VARCHAR2(50),             
        Handled_Package            NUMBER,       
        Expected_Missing_Package   NUMBER,   
        Actual_Missing_Package     NUMBER
    alter table test add constraint firs_of_month check (year_month = trunc(year_month, 'mm'));
    ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
      2  Values (to_date('2012-nov-12', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
    Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
    ERROR at line 1:
    ORA-02290: check constraint (TUBBY.FIRS_OF_MONTH) violated
    Elapsed: 00:00:00.03
    ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
      2  Values (to_date('2012-nov-01', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
    1 row created.
    Elapsed: 00:00:00.01
    ME_XE?select
      2        to_char(year_month, 'fmYYYY')    as year
      3     ,  to_char(year_month, 'fmMonth')   as month
      4     ,  Region
      5     ,  CITY
      6     ,  Handled_Package
      7     ,  Expected_Missing_Package
      8     ,  Actual_Missing_Package
      9  from test;
    YEAR         MONTH                REGION                         CITY                    HANDLED_PACKAGE EXPECTED_MISSING_PACKAGE ACTUAL_MISSING_PACKAGE
    2012         November             Western                        San Fransisco                       200                       10                      5
    1 row selected.
    Elapsed: 00:00:00.01
    ME_XE?Then you have nice a nice and easy validation that ensures you data integrity.
    Cheers,

  • How to get a distinct count of multiple columns

    I've done this before and I'll be darned why I can't recall this.
    Table with 3 columns with the primary key defined in column a.
    Row a b c
    num.
    1 020 how abc
    2 030 why def
    3 010 not ghi
    4 040 how abc
    5 050 yes def
    6 060 why def
    So what I want is a count of the unique values for columns b and c as if b and c were actually one field.
    So the result of the query would be:
    Count = 4 unique rows.
    Hopefully I'm making some sort of sense. It's a bit much to ask about the number of occurrences of each duplicate value, I'm sure just getting count of the unique rows of the non-indexed rows will be sufficient. Since the query is meant to be universal for multiple columns of numeric and alphanumeric data and can be expanded for multiple columns, I am simply trying to get a basic skeleton that works for an "on the fly" analysis.

    Thanks to all of you. I had the idea and just couldn't nail it down. You did it.
    All of you understood what I poorly communicated. My apologies for the lack of prep with a table, I was running patches on the system and couldn't dare interrupt it on my laptop and starting Oracle 11 while Micro$lop was patching all sorts of evil code. This is something I'm setting up on my own time so it's a work I'm going to try to be proud of. So there will be plenty of instrumentation and debugging code for timing.
    I'd thought of concatenating columns and was worried it wouldn't backport to older Oracle versions (work goes back to 8.1.7) with nulls and other goofy things like long raw fields or lob/clobs plus the other DBs that are at various sites. What I'm trying to do is improve on a crappy data analysis tool SAP provides to use with reporting unique columns. (Basis people could recognize this as DB05). I tried dragging out the SQL that their ABAP/4 language generates from an SQL trace but it was unusable and often dies on internal storage which on most sites is about 4GB per process. Needless to say, the program is wasteful and I'm trying to keep the work on the DB where it belongs and discourage cowboys from doing this in the DB on the fly and at the same time make it simpler for junior members to use while having a semblance of an audit trail.
    What I'm trying to do is work out a tool that checks all the crappy secondary indexes that were created by folks who seem to think in ways that are from an alien species not yet speculated about even with the strongest psychedelics. One of them actually decreases performance by a minimum factor of 5. It's not much when it's 5 seconds but when the response time averages about 3 hours beforehand, you can imagine what it was like afterward. In this particular case, the "logic" was that the index needed to be defined by the order of the fields of the select clause. Some myths never die. So it's not easy to work out which ones haven't been used in a long time, so it's down to finding which of the custom ones are actually bad in terms of selectivity. Some of these may have made a little bit of sense when the system was started up, now that some of these have millions of rows instead of a few thousand, thaw tend to expose the flaws in design.
    I'm also trying to make this work on multiple DBs such as DB2, MaxDB and (sob) SQL Squealer. The idea is to write this in ABAP code as a utility without the overhead of internal tables in ABAP as some of these tables are many millions of rows and I have to account for the size in memory. (ABAP field sizes in internal memory are generally much larger than the actual DB lengths. so every bit helps!) So I'm trying to create actual SQL on the fly and use it internally without going through the SAP DB interface which limits the type of SQL functions used and all the overhead. It's intended to grab a secondary index and if there are more than 2 fields defined, work it backwards to show unique values for all columns, all columns - 1, all columns - 2 and so on back to the initial column in the index.
    Why does this seem important? On Oracle I can generate histograms but those can often screw up SAP. On other DBs, the indexing cardinality is much more important, particularly with DB optimizers that make some odd decisions. So I need evidence I can push to folks who will only understand if there's a plain and simple analysis that explains it (almost) in crayon.
    I'm testing null values next (which worked!) but these suggestions all seem to follow the same idea which won't work in ABAP without some serious memory issues. So I'm down to this type of coding:
    exec sql.
    <dynamically generated true SQL>
    end-exec.
    rather than using ABAP with their concept of "open SQL" and the DB interface with all the overhead.
    RB's suggestion of the UNION ALL wasn't quite what I was looking for BUT it made me think that this would be a nice enhancement for evaluations!
    So the candidates that seem to work for what I wanted are as follows:
    SQL> SELECT COUNT (MIN (0)) AS distinct_col3_col4_cnt
    2 from rb group by b, c;
    DISTINCT_COL3_COL4_CNT
    7
    select count(distinct(b || c)) num_rows from rb;
    So thanks also to Frank, APNL and Nimesh for their examples. Now the fun starts as I spec out the processing.

  • How to get Select All or select Multiple columns  in OOALV

    HI Experts
    i'm assignig internal table to dynamic internal table(FS_IST_TABLE) for to display the output.
    but i'm not geting the Select ALL Option. and i can't select multiple columns at a time.
    where i can select only one column.
    how can i select multiple columns.
    please any one help me.
    regrads,
    rathan.

    Hi,
      If we want to select the multiple columns in the alv by using ooabap
    so in the class CL_GUI_ALV_GRID  it is having one method SET_TABLE_FOR_FIRST_DISPLAY
    it is having one importing parameter IS_LAYOUT of type lvc_s_layo type
    and this structure contains one field SEL_MODE and set that field value as 'A'.
    then we can select the multiple rows in alv grid

Maybe you are looking for