这是我的声明:
select TournamentID, TournamentDateTime, TournamentName, TournamentTypeName, BossTournamentID
from vwTournaments
where tournamentid in
(
select distinct(fk_tournamentid)
from tournamentprizes
where place between 1
and (select max(numranks) from tournaments)
and fk_winnerid is not null
)
and TournamentDateTime > '8/29/2013'
and
(
TournamentID like '%%'
or TournamentDateTime like '%%'
or BossTournamentID like '%%'
or TournamentTypeName like '%%'
or TournamentName like '%%'
)
order by TournamentDateTime DESC
需要修复的部分是“并且 fk_winnerid 不为空)”我想说如果所有锦标赛奖品都有一个不为空的 fk_winnerid。不只是一个奖项。