select table.*,@rn:example@sqldat.com+1 as row_num from table,(select @rn:=0) as r order by field_you_like