mysql 给select的结果添加一列序号 SET @mycnt=0; SELECT @mycnt := @mycnt +1 as mycnt, a.*, b.* FROM a, b; 表中第一列即为mycnt,从1开始计数。