I want to display the 3 different counts in one table

Hi,
I have three different counts , now I want to display the 3 counts in one table. Is it possible,
For example :
1. Select count(*) from table1 ;
Ans : 10
2. Select count(*) from table2;
Ans : 20
3. Select count(*) from table3;
Ans : 30
Now I want to display like this
A 10
B 20
C 30
Thanks

Nihar,
You can write a pl/sql block to achieve this
CREATE TABLE new_table (table_name VARCHAR2 (30), COUNT     NUMBER);
DECLARE
   CURSOR mcur
   IS
      SELECT   table_name
        FROM   user_tables
       WHERE   table_name IN ('A', 'B', 'C');
   v_sql   VARCHAR2 (100);
   v_count number;
BEGIN
   FOR x IN mcur
   LOOP
      v_sql := 'select count(*) from ' || x.table_name;
      EXECUTE IMMEDIATE v_sql INTO   v_count;
      INSERT INTO new_table
        VALUES   (x.table_name, v_count);
   END LOOP;
   COMMIT;
END;
select * from new_table;Regards

Similar Messages

  • I wanted to display the multiple rows in one row but column should be diff

    Hi
    Could any body help me regarding this query how to write to get the multiple rows in one row.
    eg.
    i have one table tab1(eno number,ename varchar2,uid1 varchar2,uid2 varchar2,uid3 varchar4)
    but when i am runing the query I am getting multiple record against one eno number because of uid1,uid2,uid3
    suppose value of table is
    eno ename uid1 uid2 uid3
    1 a u1
    1 a u2
    1 a u3
    when i am quering it is coming same as above but I want in one row
    eno ename uid1 uid2 uid3
    1 a u1 u2 u3
    can any onle help me how to write the query for this requirement.
    thanks
    saif

    which is hard coded in my code? Here another approach, but fail for c as there is no information for the value of a column: does 1 in u1 means col 1, etc.
    /* Formatted on 2012/05/29 16:29 (Formatter Plus v4.8.8) */
    WITH t AS
         (SELECT 1 col1, 'a' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'a' col2, 'u2' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'a' col2, 'u3' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u3' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u2' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'c' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'c' col2, 'u3' col3
            FROM DUAL)
    SELECT   xx.col1, xx.col2, MAX (DECODE (xx.rn, 1, col3)) AS uid1, MAX (DECODE (xx.rn, 2, col3)) AS uid2,
             MAX (DECODE (xx.rn, 3, col3)) AS uid3
        FROM (SELECT t.col1, t.col2, t.col3, ROW_NUMBER () OVER (PARTITION BY col1, col2 ORDER BY col3) rn
                FROM t) xx
    GROUP BY col1, col2;output:
    COL1     COL2     UID1     UID2     UID3
    1     a     u1     u2     u3
    1     b     u1     u2     u3
    1     c     u1     u3
    Edited by: ʃʃp on May 29, 2012 2:30 AM

  • I get the error "Cannot open port" when I want to display the directory content of one FTP servers with LabVIEW's internet toolkit functions. What is the problem? I'm logged on on the server.

    Is anyone experimenting this kind of problems or has resolved it? Thanks. I use LabVIEW 6.1 with Windows 98.

    Squish,
    This forum is for CAN questions. I would strongly urge you to repost your question to the LabVIEW General category and this is a LabVIEW question.
    Also, does the FTP Browser shipping example that comes with the Internet Toolkit work? If it does, then I would suggest studying that example. If it does not, then I would suggest reposting your question and giving much more detail about which VI is giving you the error and a general overview of the program.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • How do I make a 20 X 30 print with layers of 16 X 20, 12 X 18, 11 X 14, 8 X 12, 8 X 10, 5 X 7 and 4 X 6 of the same image to display the different sizes available to someone?  Using Elements 13 with Windows 8.1

    How do I make a 20 X 30 print with layers of 16 X 20, 12 X 18, 11 X 14, 8 X 12, 8 X 10, 5 X 7 and 4 X 6 of the same image to display the different sizes available to someone?  Using Elements 13 with Windows 8.1
    A senior citizen needs some help.
    Thanks

    Saving each image as different size - is it an option for you?  I would save images with their name as: 20x30.png, 16x20.png etc etc.
    Or explain whether you want these in a webpage  in which case only one image is necessary and different sizes are displayed with good CSS code.  this is question for Dreamweaver forum if this is what you want.

  • I want to display the number of Passed / failed tests in Testtand xml report , please help me

    Hi, I want to display the number of Passed / failed tests in Testtand xml report , please help me.
    My requirement is later i should be able to display these number of passed/failed test in report header too.
    Solved!
    Go to Solution.

    I have attached a sequence to give you an idea of how to get the Result count (I didn't check it's working ), I have used "SequenceFilePostResultListEntry" callback to calculate the Result Count,
    and the Result Count is passed to the "ModifyReportHeader" through File Globals,  where you can edit the XML file to show it in the Repot (follow the link in my previous post).
    Hope this helps
    AshwiN,
    Attachments:
    Get Result Count.seq ‏8 KB

  • Scripts : want to display the text in one line

    Dear Friends,
    i want to dispaly the below text in one line,but its displaying in next line.
    ITEM   MATERIAL  DESCRIPTION ORDERQTY  UNIT PricePerUnit NETVALUE
    i am using the following code
    IL           <K>Item,,Material,,Description ,,  Order qty.  ,,Unit   ,,    Price per unit   ,, Net value </>
    Thanks & Regards
    Shaik

    Hello Hussain,
    Remove the TAB Spacing ',,'. Instead u give the Space.
    Reduce the length of fonts.
    These are the ways to display the text in a line.
    If useful reward points.
    Regards,
    Vasanth

  • Want to display the UDID

    Hi,
    This is my first post on Adobe DPS forum.
    On one page I want to print the UDID of my iPad. But this should be a variable as whenever I open my folio on another iPad it should show the UDID of that iPad. All in all, whenever I open my folio it should display the UDID of the iPad on which I'm opening the folio. Is it possible?
    Thanks in adavance and best regards.
    With regards,
    Anil Yadav

    i don't think you have access to this 'sensitive kind of information'.
    a Google search for "html UDID display" might get you the answer in seconds.
    —johannes
    (mobil gesendet)
    Am 07.10.2011 06:11 schrieb "Anil Yadav" <[email protected]>:
       Re: want to display the UDID  created by Anil Yadav<http://forums.adobe.com/people/Anil+Yadav>in
    Digital Publishing Suite - View the full discussion<http://forums.adobe.com/message/3959005#3959005>

  • I'm using qurey panel with table.i want to display the rows as default

    Hi
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I'm using qurey panel with table , for first time when i run ,rows are not displayed as default .After i fire search button records / rows are displaying.Now i want to display the rows in table when i run for first time , mean i want to display rows by default.
    thanks in advance.

    Hi,
    if the queryPanel is based on a ViewCriteria in ADF BC then this autoExecute can be defined on the VC definition
    Frank

  • I have a key figure in my master data table i want to display the key figur

    Hi All,
    I have a key figure in my master data table i want to display the keyfigure in my report how can i display it can somebody help me in this scenario 
    Regards
    Kiran Kumar

    Hi Kiran,
    Assume that Material master data table material has price as an attribute. To get this price as key fig in query, get material number in rows and in columns create new formula with replacement path to get material price as key figure.
    Note: Without taking material number into rows, we can't get the price into columns.
    Hope this helps u..
    Cheers......
    Sk babu

  • I want to display the narrative view as All Choices

    Hi Experts,
    If ‘All choices’ option is selected, I want to display the narrative view as All Choices.
    How do I achieve it?
    Waiting for your reply....
    Regards,
    Sathyan

    Hi Sathyan,
    Set a presentation variable for that prompt.
    and in request, go to the column formula,
    CASE WHEN '@{pv_var}' IS NULL THEN 'ALL CHOICES' ELSE col_name END
    Regards,
    Raghu

  • I want to display the Employee details in table format without using iGrid

    Hi all,
    Can anybody help me that I want to display the Employee details return by transaction in table  format without using iGrid.

    Hi, view the link below.
    http://help.sap.com/saphelp_xmii115/helpdata/en/Advanced_Topics/Customizing_Output/Customizing_Output.htm
    Hope this help.
    Danilo Santos

  • I want to display the website which i have designed using jsp in telugu....

    Hi,
    I want to display the website which i have designed using jsp,mysql in telugu.I have searched a number of articles but couldn't get sufficient information.I read articles on internationalise jsp based websites but they were about converting in other languages rather than indic languages.
    Could anyone let me know the procedure to convert it into indic languages.What all are required.
    Thanks.

    (Please keep the subject line to a short descriptive sentence. Don't put your entire question there.)
    LabVIEW can communicate via serial port. If the microcontroller listens to serial data, there must be a certain command to light a LED connected to a certain port. All you need is to check the manual to find out what the serial data needs to be.
    LabVIEW Champion . Do more with less code and in less time .

  • Want to display the item in MDM2 but dont want the customer to order it

    Hi
    I want to display the item in the catalog but i want to block the material from being orderd. how do i do that?

    Hi,
    SRM-MDM Catalog has somthing like display mode. You can set it in UI customizing. If you want to block order for only some of items, please create custom filed like "display only=X" and check the value in the BADI BBP_CATALOG_TRANSFER.
    Regards,
    Masa

  • Want to display the contents of a text file in a jsp

    hi
    i am new to jsp, i want to display the contents of a text file in a jsp file ,whenever jsp file is loaded from browser.
    -thanx

    i had come up with the code
    <!-- form.jsp -->
    <%@ page import="java.io.*, java.lang.*" %>
    <%@ page language="java" %>
    <html>
    <head>
    <title>Display</title>
    </head>
    <body>
    <%
    String sample[100];
    String line;
    %>
    <%! int i=0; %>
    <%!File f1 = new File("c:\\file.txt"); %>
    <% try { %>
    <%!FileReader fi = new FileReader(f1); %>
    <% } catch(FileNotFoundException io) { } %>
    <%!BufferedReader in = new BufferedReader(fi); %>
    <%
    while((line=in.readLine())!= null)
    sample= line;
    i++;
    in.close();
    %>
    i will display sample here
    </body>
    </html>
    but i am getting error
    display_jsp.java:16: unreported exception java.io.FileNotFoundException;
    must be caught or declared to be thrown
    FileReader fi = new FileReader(f1);
    ^
    plz help
    -thanx

  • I have a Apple MacBook Pro "Core i7" 2.8 13" Late 2011. i want to upgrade its RAM from 4GB to 16GB. But OWC sells two kinds of RAM, the DDR3 and the DDR3L.What is the different and which one would work better for my mac. Thanks!!!

    Please help! I have a Apple MacBook Pro "Core i7" 2.8 13" Late 2011. i want to upgrade its RAM from 4GB to 16GB. But OWC sells two kinds of RAM, the DDR3 and the DDR3L.What is the different and which one would work better for my mac. Thanks!!!

    I don't see any DDR3L on the page for the RAM that would fit your model -> http://eshop.macsales.com/shop/memory/Apple_MacBook_MacBook_Pro/Upgrade/DDR3_133 3MHz_SDRAM.
    But the answer is that it doesn't really matter - just make certain to get 1333MHz.
    Good luck,
    Clinton
    MacBook Pro (15-inch Late 2011), OS X 10.??, 16GB Crucial RAM, Crucial M500 960GB SSD, 27” Apple Thunderbolt Display

Maybe you are looking for

  • Display Members in FR Report

    Hi, I need small help in FR, we have a requirement according to which we want to display members of a dimension all expanded on all levels. Right now we have reports which display the members in which Child member comes first then it's parent comes,

  • SQL LOADER / INFILE filename as variable in .ctl file

    I stumbled over several threads in the OTN-forums regarding this problem, but neither was it finaly solved nor did I find a FAQ that answered my question. Soooo: We get several datafiles from several sources and process them via SQL Loader and store

  • Why can't I get Word docs to "save as" or open in Pages

    I just stared using Pages and I can't seem to be able to bring a Word document into Pages; it says that I don't have "access privileges or my document is corrupted." I know it isn't corrupted; I even tried creating a new document, (in Word) just to b

  • Need a way to get downloads option from safari on dock.

    I accidentally deleted my downloads option for safari on my dock. It is also no longer in my finder. Is there a way for me to get it back?

  • Mac OS 10.6.7 Server, Safari Keeps Crashing (after failed FileMaker Server install)

    Mac OS 10.6.7 Server After several attempts of installing, uninstalling FileMaker Server 11. (FileMaker Server 11 still will not launch, Admin Console) Now totally un-installed Safari constantly crashes a few minutes after launch.