Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select count(*)
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
![]() |
![]() |