このクエリに配置する必要set @rank:=0;
がありますが、どこに配置できますか?
SELECT @rank:=@rank+1 AS rank, p.* FROM points p
inner join distributor d
on p.distributor_id=d.id_distributor
where p.month='$prev_month'
and d.group='$dist_group'
ORDER BY p.tot_point DESC
私はmysql_query("set @rank:=0;");
メインクエリの前に使用する必要があります、それは動作します。しかし、別のサーバーでは機能しません。
何か案は ?