Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Posts
    2

    Unanswered: ranking in SQL 2000 Query Analyzer

    Hello-

    I was wondering if someone could help me out. What would be the best way for me to go about determining the sale number from the following table:

    applicantID calltime result
    1 1/5/05 no sale
    1 1/15/05 no sale
    1 1/25/05 sale
    1 1/26/05 no sale
    12 1/5/05 no sale
    12 1/15/05 no sale
    12 1/16/05 no sale
    12 1/25/05 sale
    12 1/26/05 no sale

    the resulting query would provide:
    applicantID saleattempt
    1 3
    12 4

    etc. Ultimately, I am trying to figure out how many attempts needed to make a sale.

    Thank you...

    ps

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Not sure what this has to do with "ranking"....

    Code:
    select	ApplicantID,
    	Count(*) as Attempts
    from	[YourTable]
    where	result = 'no sale'
    group by ApplicantID
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Oct 2005
    Posts
    2

    Arrow clarification

    Apologies. I wasn't clear.

    I'd like to have it laid out like this:

    APPLICANT, CALL NUMBER, RESULT
    1, 1, NO SALE
    1, 2, NO SALE
    1, 3, NO SALE
    1, 4, SALE
    2, 1, NO SALE
    2, 1, SALE

    Hence, the ranking. There is a date field that would basically have to be ranked.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    See the last few posts of this thread:

    http://www.dbforums.com/t1198106.html
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •