With this select
I visualize the field of the table person with a sequential number before the field name .
SELECT @rownum:=@rownum+1 ‘fila’, nombre
FROM personal t, (SELECT @rownum:=0) r;
The output is something like this:
list / name
1 Luis
2 Carlos
3 Esteban
But I need to add another correlative and get something like this:
list / sublist / name
1 5 Luis
2 6 Carlos
3 7 Esteban
I tried to use something like this:
SELECT @rownum:=@rownum+1 ‘fila’, @rownum:=@rownum+1 ‘sublista’, nombre
FROM personal t, (SELECT @rownum:=0) r, (SELECT @rownum:=5) s
But I get this:
list / sublist / name
5 6 Luis
7 8 Carlos
9 10 Esteban
Is there any way to achieve what I need?