mysql:13050
From: "rishiri.info" <"rishiri.info" <mail@xxxxxxxxxx>>
Date: Fri, 2 Jun 2006 12:45:36 +0900
Subject: [mysql 13050] 追加で男女別rankフィールドを設けたい
こんにちは、rishiri.infoです。 set @r1 = 0; ←初期化? @r1:=(@r1 + 1) as rank ←+1していく? で全体の順位をつけられることはわかったのですが SELECT kiroku.scode As scode, sensyu.namae As namae, sei.seibetsu As seibetsu, max(if(kiroku.kcode = 4, kiroku.ktime, null)) As 4P, max(if(kiroku.kcode = 9, kiroku.ktime, null)) As 9P, max(if(kiroku.kcode = 13, kiroku.ktime, null)) As GP, timediff(max(if(kiroku.kcode = 13, kiroku.ktime, null)),'06:00:00') As tdiff, @r1:=(@r1 + 1) as rank FROM kiroku,sensyu,kukan,sei WHERE kiroku.scode = sensyu.scode AND kukan.kcode = kiroku.kcode AND sei.seicode = sensyu.seicode GROUP BY scode, namae, seibetsu ORDER BY GP ASC; 聞いてばかりで申しわけありませんが これに男女別rankフィールドを追加して 男女別でも順位をつけることは可能でしょうか? -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.8.1/354 - Release Date: 2006/06/01
-> 13050 2006-06-02 12:45 ["rishiri.info" <mail] 追加で男女別rankフィールドを設けたい 13051 2006-06-02 14:36 ┗["F.Y" <fumi_sby@xxxx] 13054 2006-06-02 22:52 ┗["rishiri.info" <mail]