[MySQL]Pomoc w ułożeniu zapytania

0

Witam, prowadzę grę internetową, i mam tam ranking graczy:

$ranking=baza_dane($baza, 'select id, login, zlotowka, aktywny, (select count(*) from pole where czyje=login.id) as ile from login, surowce where login.id!='.admin_id().' and aktywny!=0 and login.id=surowce.czyje order by ile desc, zlotowka desc limit '.($podstrona*$na_strone).', '.$na_strone);
create table login(
id int unsigned not null primary key auto_increment,
login char(16) not null,
haslo char(32) not null,
email char(128) not null,
aktywny int unsigned not null
);

create table pole(
id int unsigned not null primary key auto_increment,
czyje int unsigned not null,
typ tinyint unsigned not null, /*1-uprawa, 2-hodowla, 3-sad*/
co tinyint unsigned not null, /*0-nic, 1-ziemniak, 2-pomidor ...*/
gotowe int unsigned not null,
index(czyje)
);

create table surowce(
czyje int unsigned not null primary key,
ziemniak mediumint unsigned not null,
pomidor mediumint unsigned not null,
ogorek mediumint unsigned not null,
rzodkiewka mediumint unsigned not null,
salata mediumint unsigned not null,
jajko mediumint unsigned not null,
mieso mediumint unsigned not null,
mleko mediumint unsigned not null,
jablko mediumint unsigned not null,
gruszka mediumint unsigned not null,
zlotowka float(9, 2) unsigned not null
);

Tym zapytaniem jestem wstanie utworzyć ranking graczy, ale potrzebuje też znaleźć miejsce w rankingu gracza o podanym id. Oczywiście mogę pobrać cały ranking i przeszukać go w PHP, ale graczy jest dość dużo.

0

W where daj warunek login.id = szukaneid

1 użytkowników online, w tym zalogowanych: 0, gości: 1