Re: How to count the result from sql statement?

From: David Harper (devnull_at_obliquity.u-net.com)
Date: 02/13/04

  • Next message: UGENT: "Re: Create Access databases programmatically via JDBC-ODBC?"
    Date: Fri, 13 Feb 2004 07:24:06 +0000
    
    

    kaiwing18@hotmail.com wrote:
    > I want to know how to count the result of sql from oracle9i.
    > For example,
    >
    > "Select * from student where course_id='101'"
    >
    > if the result is two ppls, how can i retrieve this value
    > form sql statement?

    If you only want to know the number of matching rows, without having
    to download all of the data, you should use the "count" function:

       Select count(*) from student where course_id='101'

    That way, you don't need to download 100,000 rows when all you want
    to know is "There are 100,000 students on course 101".

    David Harper
    Cambridge, England


  • Next message: UGENT: "Re: Create Access databases programmatically via JDBC-ODBC?"

    Relevant Pages

    • Re: WINSSH.EXE and WINSRT.EXE SQL Virus
      ... | SQL v7 or SQL 2000. ... * propagates to machines vulnerable to the following exploiting RPC/RPCSS DCOM and LSASS ... You need to downlaad the following tool to all infected computers and download the needed ... This will bring up the initial menu of choices and should be executed in Normal Mode. ...
      (microsoft.public.security.virus)
    • RE: Error installing (KB 921896)
      ... wonder if there is a way to wipe the download from my system and start over. ... Installation status: Failed ... This service pack upgrades all Microsoft SQL Server 2005 Express Edition ...
      (microsoft.public.windowsupdate)
    • Membership download
      ... I'm fairly new to using SSIS, but I have learned how to download the contents of a custom database to a local development server (both with SQL 2005). ...
      (microsoft.public.sqlserver.dts)
    • Re: Services not listed on Configuration Manager screen?
      ... That's a very odd version! ... I don't remember under which build number SP2 was originally released as, ... there you should be able to find a download. ... Links for SQL Server Books Online: ...
      (comp.databases.ms-sqlserver)
    • Re: 932557 64 bit Error Code: 0xA97 Update is not allowed to down
      ... The Windows Update has been trying to update this one since before the fourth ... is inaccessible to me through SQL Manager. ... I think the reason the update is not allowed to download is ... Sequence 2940 vs AcceptRate 2513. ...
      (microsoft.public.windowsupdate)