Sara needs your help

Discussion in 'PHP' started by anasgha, May 21, 2007.

  1. #1
    Hello everybody,
    I am stuck in this problem. if you can help that will be highly appreciated.

    I have a table conatins information about players, each player has certain scores in every possition, and scores in every team.
    I can not modify the table.

    this is the table

    Players table

    Position Teams
    School name
    Defender Striker Midfielder Goalkeeper Team1 Team2 Team3 Team4
    A Tomas 12 85 71 15 10 74 100 38
    A Alex 1 3 11 4 09 55 2 23
    B Carlos 84 51 20 40 45 48 42 52
    B Jack 91 10 42 38 46 16 18 13
    B John 99 43 17 78 99 88 53 12
    C Sami 18 15 42 56 19 14 62 26
    D Tony 37 82 37 42 43 17 64 24
    D Peter 59 16 17 27 72 22 17 14
    D Jemy


    1-List players whose highest scores are (Goalkeeper)


    2- List players whose highest scores are(Defender), if the two are from the same school choose the highest the one with the highest score.


    3- List players whose highest scores are (Striker) Or team is (team2)



    4- List players whose highest scores are (Striker) Or team is (team2), if there are more than one from the same school please choose the one with the highest score.


    Please if you know the answer tell me ? I am really in need.

    Sara
     
    anasgha, May 21, 2007 IP
  2. Free Directory

    Free Directory Peon

    Messages:
    89
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Perhaps you need sql commands?
    1: SELECT * FROM `players_table` WHERE (goalkeeper>midfielder and goalkeeper>striker and goalkeeper>defender) ORDER BY goalkeeper desc;
    2: same as 1, for defender, and put GROUP BY school. I think it works?
    3: same as 1, for striker and add before ORDER BY that: AND team='team2'
    4: left for others;)
     
    Free Directory, May 21, 2007 IP