SELECT (@ROW := @ROW +1 ) AS rowInt ,t.* FROM user_ne_area t, ( SELECT @ROW :=0 ) r WHERE t.user_or_group_id=31 AND t.`type`=4 在调试时前面添加一个序号方便调试