Tuesday, 15 April 2014

SELECT Specific Row After Processing Whole Statement In MySQL -



SELECT Specific Row After Processing Whole Statement In MySQL -

here illustration results:

+------+-----------------+--------+ | rank | nick | amount | +------+-----------------+--------+ | 1 | 038112125147518 | 0.2000 | | 2 | 0tosan | 0.2000 | | 3 | 13unnyeater | 0.2000 | +------+-----------------+--------+

which returned set / select statement:

set @rank=0; select @rank:=@rank+1 rank, nick, amount points;

what efficient way homecoming row matching:

nick='13unnyeater'

...after 'rank' column tabulated using above? result expect be:

+------+-----------------+--------+ | rank | nick | amount | +------+-----------------+--------+ | 3 | 13unnyeater | 0.2000 | +------+-----------------+--------+

mysql

No comments:

Post a Comment