从数据库中挑出前三名 [英] Picking out top three out of database

查看:103
本文介绍了从数据库中挑出前三名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库,我存储有关足球运动员目标的信息。

数据库包含以下内容:

GoalID,GoalScorerID,GoalMinute(目标得分的分钟数),

ClubID,FixtureID(标记)点球进球得分)和

点球(确定目标是否是点球)。


在俱乐部页面上我想要显示俱乐部前三名的进球者。

我能做到这一点,但我不知道如何按降序排列

与得分最高的球员列表顶部的目标。


任何想法?

I have a database where I store info about football players goals. The
database contains the following:
GoalID, GoalScorerID, GoalMinute (which minute the goal was scored),
ClubID, FixtureID (to mark in which match the goal was scored) and
Penalty (which determines wether the goal was a penalty or not).

On the club page I want to show the top three goalscorers of the club.
I can do this but I don′t know how to get them in descending order
with the player who′s scored most goals at the top of the list.

Any ideas?

推荐答案

SELECT TOP 3


ORDER BY玩家DESC或ASC
SELECT TOP 3
and
ORDER BY player DESC or ASC


2004年12月8日00:23:02 -0800, th *********** @ hotmail.com (托马斯)

写道:
On 8 Dec 2004 00:23:02 -0800, th***********@hotmail.com (Thomas)
wrote:
我有一个数据库,我存储有关足球运动员目标的信息。
数据库包含以下内容:
目标ID,GoalScorerID,GoalMinute(目标得分的分钟),
ClubID,FixtureID(标记目标得分的匹配)和
罚球(确定目标是否是罚球)。

在俱乐部页面上我想展示俱乐部的前三名球员。
我可以这样做,但我不喜欢我不知道如何以降序获得最多目标的玩家降序。

任何想法?
I have a database where I store info about football players goals. The
database contains the following:
GoalID, GoalScorerID, GoalMinute (which minute the goal was scored),
ClubID, FixtureID (to mark in which match the goal was scored) and
Penalty (which determines wether the goal was a penalty or not).

On the club page I want to show the top three goalscorers of the club.
I can do this but I don′t know how to get them in descending order
with the player who′s scored most goals at the top of the list.

Any ideas?




很多,有些相当简单。有些可能不适用于您的数据库。

如果您告诉我们什么是数据库,我们可以建议一个解决方案。


(提示:检查一下你的数据库)特定数据库在SELECT语句中支持TOP

修饰符...)


Jeff



Lots, some rather simple. Some may not apply to your database though.
If you tell us what database, we can suggest a solution.

(Hint: Check to see if your particular database supports the TOP
modifier in a SELECT statement...)

Jeff


很抱歉没有提前回答,但这有点太多了。


使用的数据库是Access。我不知道它是否支持TOP修饰符。

如果不使用Access,我应该使用哪个db。我需要它是免费的。


***通过Developersdex发送 http://www.developersdex.com ***

不要只参加USENET ......获得奖励!
Sorry for not answering earlier but it′s been a bit much to do.

The db used is Access. I have no clue if it supports the TOP modifier.
If not Access is to be used which db should I use. I need it to be free.

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


这篇关于从数据库中挑出前三名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆