c# - Getting Top 3 from Mysql table based on Condition/Value -
i need top 3 forwards,top 3 midfielders,top 4 defenders based on soccer players position
i have separate table position
structure of position table
positionid , positionname
1 tor(which means goal keeper)
2 abwehr(which means defenders)
3 mittelfeld(which means midfielders)
4 angriff(which means forwards)
and have soccerplayers table there name(player name),positionid,tscore(player score)
i need top 3 players each position based on tscore
any query suggestion ??
well can try query set:
(select name, positionid, tscore soccerplayers positionid = 1 order tscore limit 3) union (select name, positionid, tscore soccerplayers positionid = 2 order tscore limit 4) union (select name, positionid, tscore soccerplayers positionid = 3 order tscore limit 3)
Comments
Post a Comment