Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: select count(*)

Re: select count(*)

From: Norris <johnnie_at_cooper.com.hk>
Date: 10 Aug 1999 11:25:58 GMT
Message-ID: <7op286$m7r$1@imsp009a.netvigator.com>


If I want to add a where clause, the syntax is

select 	col1,col2,a 
from 	table1
,	(select count(*) a from table1 where col1 = 'xyz')
where	col1 = 'xyz' 

Can I simplify the above query so that the where clause wouldn't repeat?

In comp.databases.oracle.misc Maiko <maiko_at_dds.nl> wrote: : select col1, col2 , a from table1, (select count(*) a from table1) : /

: On 10 Aug 1999 09:00:09 GMT, Norris <johnnie_at_cooper.com.hk> wrote:

:>In SQL Server, I can do the following queries:
:>
:>select col1, col2, count(*) total_record
:>from table1
:>
:>select col1, col2, (select count(*) from table1) total_record
:>from table1
:>
:>In Oracle, how can I do that?

--
---
http://www.washington.edu/pine/faq/ Received on Tue Aug 10 1999 - 06:25:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US