Results 1 to 3 of 3

Thread: about self join

  1. #1
    Join Date
    Jul 2003
    Posts
    421

    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.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    You don't need self join for that, you can use GROUP BY

    select status, count(*)
    from table
    group by status

  3. #3
    Join Date
    Jul 2003
    Posts
    421
    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
  •