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)
 Tricky SQL Queries

Author  Topic 

thussain
Starting Member

7 Posts

Posted - 2001-07-17 : 15:49:07
I have two tables

People Assignemnt

People_id Assign_id
Status People_id
Creation_date Start_date

I am trying to run this query

Show people group by status was created on this date and have assignment under this date, or have any assignment at all

the result looks like

Status Count Percent Assign# EverAssign
ACTIVE 12 54.45% 4 6
CLOSE 4 18.18% 12 12
MAP 6 27.27% 11 13

The query I try to ran is

Select count(people_id),status,
(select count(assign_id) from assignment
group by people_id
where assignment.people_id=people.people_id
and start_date='01/01/01')
from people
where creation_date ='01/01/01'


I am trying not to use cursor or temp tables.





   

- Advertisement -