SQL ステートメントは
select a.username,(@rowNum:=@rowNum+1) as c,a.integral as 积分from xs_user a,(Select (@rowNum :=0 ) ) b order by integral DESC,time
ユーザー名を知っていますか? ユーザー名 = ユーザー名であるテーブルからポイントを直接選択します。
SELECT * FORM ( select a.username,(@rowNum:=@rowNum+1) as c,a.integral as 积分 from xs_user a,(Select (@rowNum :=0 ) ) b order by integral DESC,time ) T WHERE username='XXX'
このユーザー変数の定義方法は依然として非常に賢いです
SELECT * FORM ( select a.username,(@rowNum:=@rowNum+1) as c,a.integral as 积分 from xs_user a,(Select (@rowNum :=0 ) ) b order by integral DESC,time ) T WHERE username='XXX'
このユーザー変数の定義方法は依然として非常に賢いです
SELECT * From ( select a.username,(@rowNum:=@rowNum+1) as c,a.integral as 积分 from xs_user a,(Select (@rowNum :=0 ) ) b order by integral DESC,time ) T WHERE username=18511337033'
[SQL] SELECT * From ( select a.username,(@rowNum:=@rowNum+1) as c,a.integral as 积分 from xs_user a,(Select (@rowNum :=0 ) ) b order by integral DESC,time ) T WHERE username=18511337033'[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 6
SELECT * FORM ( select a.username,(@rowNum:=@rowNum+1) as c,a.integral as 积分 from xs_user a,(Select (@rowNum :=0 ) ) b order by integral DESC,time ) T WHERE username='XXX'
ユーザー変数を定義するこの方法は、やはり非常に賢いです