Answer the question
In order to leave comments, you need to log in
How to add incremental field to mysql output?
I don’t know how to call it correctly, but in general I need to display some data and that with each entry a field is displayed indicating its number. Like this:
row1: field1, field2, 1
row2: field1, field2, 2
...
rowN: field1, field2, N
Answer the question
In order to leave comments, you need to log in
SET @id = 0;
;
SELECT
@id := @id+1,
table.`field1`,
table`field2`
FROM `table`
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question