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)
 What's wrong with this script?

Author  Topic 

bulubuk1976
Starting Member

24 Posts

Posted - 2008-09-26 : 20:40:48
SELECT (select count(*)
FROM ESSResults
WHERE surveyset like '%T%')/(Select count(*) From ESSResults)

I just want to get the % of the filtered group from the entire group. Please help.

Thanks!

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2008-09-27 : 01:08:04
select sum(case when surveyset like '%T%' then 1.0 else 0.0 end)/count(*) from ESSResults


elsasoft.org
Go to Top of Page
   

- Advertisement -