-
about self join
when we use self join, if I have table contain some Feetype, status( normal, Split, Unsuccessful) how can I get the count(success),success=normal, Split
and the count( Unsuccessful) at some time
________
Amc Computerized Engine Control
Last edited by sql; 03-06-2011 at 02:11 AM.
-
You don't need self join for that, you can use GROUP BY
select status, count(*)
from table
group by status
-
thank you ,
I need to group by FeeType;
Year one or not year one
successful or Unsuccessful , on meantime , i have select
select FeeType,processStatus, Count(*) from PostStatus, Records, student
where PostStatus.UserId=Records.UserId
and PostStatus.UserId=student.UserId
and Year<>'1'
group by FeetYpe,processStatus
________
Ls
Last edited by sql; 03-06-2011 at 02:11 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|