Re: [SQL] COUNT func

2001-10-18 Thread Bhuvan A
hi, try this too.. select count(*),age,status from person where age=40 and status='MARRIED' group by age,status; Regards, Bhuvaneswar. On Oct 18, Oleg Lebedev wrote: > Hi, > I am trying to count the number or rows in a table with similar field > values. I want to do it in one table sca

Re: [SQL] COUNT func

2001-10-18 Thread Stephan Szabo
On Thu, 18 Oct 2001, Oleg Lebedev wrote: > Hi, > I am trying to count the number or rows in a table with similar field > values. I want to do it in one table scan. > In other words, say I want to count the number of rows in Person table, > having age equal to 40, and the number of rows with stat

Re: [SQL] COUNT func

2001-10-18 Thread Oleg Lebedev
It worked! I checked the query plan it generates, and it's really a one-pass scan. thanks, Oleg Stephan Szabo wrote: > On Thu, 18 Oct 2001, Oleg Lebedev wrote: > > > Hi, > > I am trying to count the number or rows in a table with similar field > > values. I want to do it in one table scan. > >

[SQL] COUNT func

2001-10-18 Thread Oleg Lebedev
Hi, I am trying to count the number or rows in a table with similar field values. I want to do it in one table scan. In other words, say I want to count the number of rows in Person table, having age equal to 40, and the number of rows with status as 'married'. I want Person table to be scanned on