原SQL
select terminal_no from biz_terminal_info where length(terminal_no)>7 group by terminal_no;
修改后
SET @mycnt=0;
select @mycnt := @mycnt +1 as mycnt,terminal_no from biz_terminal_info where length(terminal_no)>7 group by terminal_no;
select terminal_no from biz_terminal_info where length(terminal_no)>7 group by terminal_no;
SET @mycnt=0;
select @mycnt := @mycnt +1 as mycnt,terminal_no from biz_terminal_info where length(terminal_no)>7 group by terminal_no;
本文标题:在mysql结果集中,增加序号列
本文链接:https://www.haomeiwen.com/subject/efrmmttx.html
网友评论