total number of rows in the result

Hello..

I have a query_x with columns Col1, Col2, Col3 following and would like to get the total number of lines for my query_x so

-Query_x
SELECT
Col1,
Col2,
COL3

Of
X, Y, Z

WHERE
...=..

Group
Col1,
Col2,
COL3

Thanx
SQL> select empno, ename , sal, count(*) over (order by null) total_rows from emp ;

     EMPNO ENAME             SAL TOTAL_ROWS
---------- ---------- ---------- ----------
      7369 SMITH             800         14
      7499 ALLEN            1600         14
      7521 WARD             1250         14
      7566 JONES            2975         14
      7654 MARTIN           1250         14
      7698 BLAKE            2850         14
      7934 MILLER           1300         14
      7788 SCOTT            3000         14
      7839 KING             5000         14
      7844 TURNER           1500         14
      7876 ADAMS            1100         14
      7900 JAMES             950         14
      7902 FORD             3000         14
      7782 CLARK            2450         14

14 rows selected.

HTH
SS

Tags: Database

Similar Questions

  • How to display the total number of rows in the dashboard

    Hello

    I have a dashboard report for retrieving the list of projects and details, it grows on a daily basis, instead of users downloading the report and find out the total number of projects, I want to display 'the total number of projects' alone in the dashboard. How can I do?

    Also is it possible to do like a pop up or something a little flash news - not necessary, but will be very good if I can do it.

    Thanks for your time and your help.

    create a report and a column to write a column invert the function max (rcount (1)). Call this column depending on the position of the column (as @1) in narrative mode.
    You can view only the narrative in the dashboard.

    for flash type of report, you can use the ticker view and call the same column in the view.

    refer to this link to view the total number of records
    http://Siebel.ITtoolbox.com/groups/technical-functional/Siebel-Analytics-l/display-row-count-in-top-of-the-table-view-3704999

    assign points if found useful.

  • Get the number of rows in the oracle table

    Hi all
    I want to get the total number of rows in the sql to the appmodule table.
    After you apply the criteria to view some on the view object. If he try with getallrowsinrange the number of rows found within the viewobject was but I want a total number of rows in the sql table.

    How can I get that

    I use jdev 11.1.1.5

    Thanks in advance

    I threw something together, quick and dirty, don't hesitate to optimize.

    Assuming you want the County table, I put the code in a subclass of EntityDefImpl since it is representing a table in the middle tier.

    public class EmpDefImpl
          extends EntityDefImpl {
      /**
       * This is the default constructor (do not remove).
       */
      public EmpDefImpl( ) {}
    
      //~ Methods ****************************************************************************
    
      public long getTableRowCount( DBTransaction transaction ) {
        String query = getQuery( );
        String countQuery = String.format( "SELECT COUNT(*) FROM (%s)", query );
        long count = 0;
    
        ViewObject vo = transaction.createViewObjectFromQueryStmt( countQuery );
    
        try {
          vo.executeQuery( );
    
          Row row = vo.first( );
          Number number = (Number)row.getAttribute( 0 );
          count = number.longValue( );
        } finally {
          vo.remove( );
        }
    
        return count;
      }
    }
    

    Depending on your card type, you may not get an oracle.jbo.domain.Number, but something else, so the cast may need correction.

    Usage example:

    public class EmpEditViewImpl extends ViewObjectImpl {
      public EmpEditViewImpl() {
      }
    
      protected void executeQueryForCollection( Object object, Object[] object2, int i ) {
        super.executeQueryForCollection( object, object2, i );
    
        EmpDefImpl def = ( EmpDefImpl )getEntityDef( 0 );
        long tableRowCount = def.getTableRowCount( getDBTransaction() ) );
    
        // Do something with it
      }
    }
    

    As you can see, the code is fairly generic. Also, you might be able to put this in a base extension ADF class.

    Sascha

    Published by: Sascha Herrmann on June 7, 2012 14:39

  • total number of rows returned, how to learn it

    Hello
    I think that in Oracle should be some simple var which contains the number of rows returned, can someone help me with this.
    I actually do it:
    INSERT INTO TT_1 SELECT * FROM TT_2 WHERE COND_01.

    Here so get the total number of rows populated without COUNT (*) extra.


    TX
    TR

    If you want to see in PL/SQL you can do it like this:

    SQL> set serveroutput on
    SQL> create table t1 as select * from all_tables where 1 = 0;
    
    Table created
    SQL> BEGIN
      2    INSERT INTO t1 SELECT * FROM all_tables;
      3    dbms_output.put_line('Rows inserted: ' || SQL%ROWCOUNT);
      4  END;
      5  /
    
    Rows inserted: 2238
    
    PL/SQL procedure successfully completed
    
    SQL> 
    
  • Error creating a salary. ORA-01422: exact fetch returns more than the requested number of rows in the hr_maintain_proposal_swi procedure insert_salary_proposal package

    Hi all

    We try to add new proposal for a salary of some employees from form August 1, 2015 (the Date of the beginning of employee)

    There is no existing salary proposal doesn't exist for these employees.

    We get below error.


    ORA-01422: exact fetch returns more than the requested number of rows in the hr_maintain_proposal_swi procedure insert_salary_proposal package


    Help, please.

    Thank you

    Tarun

    Hi John,.

    If it helps, take a look at the following note:

    ORA-01422 exact Fetch returns more than number of lines requested in Hr_maintain_proposal_swi (Doc ID 1673527.1)

    Kind regards

    Rajen

  • No sales the total number of fotografías en vidéoconférence del ano (No. leaves the total number of photos in the year of the record)

    Hola: Desde ayer Ligthroom no CC no marca el number total of fotografías en the vidéoconférence main del ano, en los meses TR. ¿pueden help me? (Hello: since yesterday Lightroom CC didn't mark not the total number of photos in the main folder of the year, if in the months. can you help me?)

    On the main menu, click library, click {view the Photos in subfolders} to turn.

  • How can you tell the total number of photos in the Organizer 11 PES

    I used PSE 9, and there was a line at the bottom that says the total number of photos in the Organizer.  I now PES 11 and I find no such line, and I have not found a way to say the total number of photos in my organizer.  Where is this information?

    Thanks for your help.

    You should see at the bottom left of the Organizer.

  • How to list the Total number of messages in the specific queue

    Hi all
    Message queue
    How to list the total number of messages in the specific queue using wlst

    Published by: 666666 on 8 March 2012 04:42

    You might have more luck post it on the forum JMS...

  • total count of rows in the vo.

    Dear all,

    I have an af:showDetailItem in which I have an af:table. I want to show the total number of records in the header of af: showDetailItem.
    example:
    Employees (count = 10)

    If someone has an idea how to fix this. ?


    Kind regards
    Sicard.

    Component              Version
    ================================================
    ADF Business Components         11.1.1.59.23
    Java(TM) Platform         1.6.0_21
    Oracle IDE              11.1.1.4.37.59.23
    Versioning Support         11.1.1.4.37.59.23

    You can use estimatedRowCount on the binding of the tree.
    Sample:

    
         
              .
              .
              .
         
    
    

    Jean Lou

  • How to exclude the each row of the result set XML declaration?

    Hello

    I have a table with an XMLTYPE column and would like to SELECT a set of rows. How can I exclude the each row of the result set XML declaration? My query currently looks like this, I am running through Spring JDBC:
    SELECT XMLSerialize FROM t1 WHERE XMLEXISTS('$e/Event' PASSING XMLTEXT AS "e") ORDER BY t1.time DESC myschema.event (HAPPY t1.xmltext)

    After selecting, in my application I convert each line in a string and concatenate all the rows in a large chain to analyze in a DOM model. I get a parser exception (org.xml.sax.SAXParseException: the target of the processing instruction corresponding to "[xX] [mM] [he's]" is not allowed) because there are several XML statements in my large chain. Of course, I could manually check the string on each line if it starts with the XML declaration, but it would be nicer if I could load the DB does not add it in the first place. Is there a way?

    Thank you!
    -Daniela

    Hello

    Some options that I can think of:

    SELECT XMLSerialize(CONTENT
     XMLtransform(t1.xmltext,
      xmltype('
     
     
    ')
     )
    )
    FROM myschema.event t1
    WHERE XMLEXISTS('$e/Event' PASSING XMLTEXT AS "e")
    ORDER BY t1.time DESC
    ;
    

    or quite simply,.

    SELECT XMLSerialize(CONTENT
      extract(t1.xmltext,'/')
    )
    FROM myschema.event t1
    WHERE XMLEXISTS('$e/Event' PASSING XMLTEXT AS "e")
    ORDER BY t1.time DESC
    ;
    
  • Display the option button if the number of rows in the table is equal to 1

    I'm having issues there buy maybe a simple script out there.

    I have a table which can have up to four lines. If the table contains only one row, an option button can be clicked to change the format/entry of cells in this row. I have to hide this box of a user option, if they added more of a line to the table and make it available again if they reduce the number of lines to one.

    I have everything else works well (radio buttons change line format, add/delete rows in the table using buttons, number of rows in the first column)

    Anyone have any ideas?

    See you soon

    Bobby

    You can place it in the code that adds more lines when running... If you have questions send the fomr to [email protected] so I can check it out...

    Thank you

    Srini

  • How to determine the number of rows in the database and save the result to a local variable?

    Hello

    I'm a newbie in the use of TestStand, databases and SQL, and now I've met difficulties. I use TestStand 2014 (32 bit).

    I have a need to know the number of rows in a database and save that number in a local variable. I tried to practice using the database of the Types of step provided with TS. I tried to use the following in a SQL statement:

    Locals.NumberOfRows = ("SELECT COUNT (*) FROM TEST_TABLE")

    It returns an error: specified value is not the expected type. My goal is possible in this way, or I'm doing this completely wrong?

    -RautSa

    Thank you for your response, Norbert. I have a database of who wins new values at random, and sometimes I need the exact number of rows in this table.

    I managed to achieve my goal by using the SQL statement: "SELECT COUNT (*) as Rowcount OF TEST_TABLE", followed by a data GET operation, which records that number of lines in a local variable.

    -RautSa

  • Count the total number of rows found in the schema

    Count the total number of lines present in the schema, including the table, sequence, view

    Desirable output

    Table sequence views
    20 of 1000 1000

    Do you mean that you need to count the number of Tables, views and sequence present in the schema?

    Hi something like that.

    SELECT a.view_cnt AS "View Count", b.tab_cnt AS "Table Count",
           c.seq_cnt AS "Sequence Count"
      FROM (SELECT COUNT (*) view_cnt
              FROM USER_VIEWS) a,
           (SELECT COUNT (*) tab_cnt
              FROM USER_TABLES) b,
           (SELECT COUNT (*) seq_cnt
              FROM USER_SEQUENCES) c
    

    Gives you,

    View Count      Table Count      Sequence Count
           153              878                   32
    

    Thank you
    Shankar

    Published by: Shankar Viji on August 28, 2012 03:03

  • number of rows in the table

    Hi master,

    I have a requirement. During the passage of a table, I need to get the number of rows in this table. Sometimes, when I spend 2 or more table names, I need to get the same count of result of lines. I got the below function. but it shows all the rows in the table. I want pariticular tabels only. How I can I get it.

    Select table_name, num_rows from all_tables where table_name in ('EMP', 'Department');  I tried.  I need to a procedure or function. who will pass the name of the table as a parameter and 1 or more than the name of a table if I pass, I need to display information from table name and number of lines.

    CREATE OR REPLACE

    TYPE t1_obj AS OBJECT)

    table-name VARCHAR2 (30),

    CNT NUMBER

    )

    /

    CREATE OR REPLACE

    TYPE t1_obj_tbl AS THE t1_obj TABLE

    /

    CREATE OR REPLACE

    FUNCTION (f1)

    p_schema_name VARCHAR2

    )

    RETURN t1_obj_tbl

    PIPELINED

    IS

    v_retval t1_obj: = t1_obj (null, null);

    BEGIN

    FOR v_rec IN (SELECT table_name FROM dba_tables where owner = upper (p_schema_name) and nvl (iot_type, 'X')! = "IOT_OVERFLOW") LOOP

    v_retval.table_name: = v_rec.table_name;

    RUN IMMEDIATELY "SELECT COUNT (*) FROM" | p_schema_name | '.' || v_rec.table_name

    IN v_retval.cnt;

    PIPE ROW (v_retval);

    END LOOP;

    RETURN;

    END;

    Select * from table (f1 ('scott'));

    The above function returns information from the table in SCOTT scheama. I need only perticular table info.

    Please notify.

    AR.

    Hi Sven,

    Front end people ask me the requirement. They wanted a proc or function as I want.

    Please help me.

    Concerning

    AR

  • See the number of rows affected the performance of sqlplus to a sql file

    Hello

    It's just we have a sql file that contains a bunch of select/update/insert statements.

    I have a unix script that calls sqlplus on this sql file. However, at the exit I don't get the number of rows affected.

    Without adding any code in the input sql file, how can I change the code of sqlplus shell script to print the number of rows affected for each statement in the sql file?

    ${ORACLE_HOME}/bin/sqlplus -L >> ${LOG_FILE} 2>&1  << EOF
      ${ORAID}/${ORAPASS}@${ORAINS}
      whenever sqlerror exit sql.sqlcode;
      set echo on;
      set feedback off;
      set serveroutput on;
      @${SQL_FILE};
      exit;
    EOF
    RC=$?
    

    The SQL_FILE of entry content is:

    select 12 "col1" from dual;
    select 'abcd' "col2" from dual;
    select;
    select 13 'col3' from dual;
    

    The result of the race of sqlplus is (LOG_FILE):

    SQL*Plus: Release 11.2.0.2.0 Production on Fri Jun 6 14:28:00 2014
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    Enter user-name: 
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    
    SQL> SQL> SQL> SQL> SQL> SQL> select 12 "col1" from dual;
    
          col1
    ----------
            12
    SQL> select 'abcd' "col2" from dual;
    
    col2
    ----
    abcd
    SQL> select;
    select
         *
    ERROR at line 1:
    ORA-00936: missing expression
    
    
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    

    Thank you

    Srinivas - y.

    1. echo setting
    2. Set feedback off;

    use

    Set of feedback on

Maybe you are looking for

  • Satellite L650-16w: BIOS 2.40 fan does not start standby mode after

    I have the toshiba Satellite L650-16wthe version of the bios is 2.40 I have a problem: when turning on the pc, the fan speed is still 90%, whatever the pc, and if the computer goes into sleep mode the fan stops and does not restart and I got the mess

  • Portege R830 - Free WiFi does not

    So happy my wife bought me a new Portege R830 for my 60th birthday. Went to Wethersppoons to use their WiFi that I do not have WiFi at home and took it and my old phone old piece of junk. Can't get my R830 at work what either on a dial-up speed and t

  • launch *.exe to view lab &amp; write on it.

    Hello I use LV 8.2. I understand that 'executable system' can be used to launch applications or files *.exe, which works very well for me. My problem is writing text in the application is started or the exe file. I can explain for example - I used 'e

  • Question NMH300 still have time

    OK, here is a real "funny" matter of time.  After the getting set so that I COULD choose the city for my time zone, the clock of the 'system' does not change.  Select ANY city you want, the time remains the same. Come on now... Ideas? Avi files get s

  • BlackBerry Smartphones Bring inbox to display on the Bold 9900

    Hello My BB bold 9900 is showing all emails at the office, to access the Inbox I have to go to the display folder and select the Inbox. I wonder if I can create a shortcut to the Inbox on my bb desktop? Thank you Bezi