Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Question on count

Author  Topic 

vineela
Starting Member

1 Post

Posted - 2004-07-06 : 11:08:58
Hi All,

I have a question on how to get the count of a particular query.

I have a table(Student) with the following colums:say a,b,c,d,e
Primary Key is on a and b columns.
The query i want to execute is

select distinct a, a+'-'+c,d from student order by d,a
Now, my question is

How to get the count of the above query

Pls suggest a query which returns the count of the above case

Regards
Vineela


Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-07-06 : 11:49:33
Declare @myCount int

Select @myCount = count(*) From (Select distinct a, c, d From student) as A


Corey
Go to Top of Page
   

- Advertisement -