How can I create in ONE single query where it returns the first column with the log counter? Or in other words How can I list the results of a single select?
Example:
---------------------------
No. | Nombre
---------------------------
1 | Jose Vaca Cipres
---------------------------
2 | Jesus Gonzales
---------------------------
3 | Edgar Hernandez
---------------------------
Using a custom variable:
In this way you can obtain the count of the records that you require
You can refer to the following link for more information. http://totaki.com/poesiabinaria/2013/01/number-the-results-of-a-select-in-mysql/
When you use a query the statement with
INNER
,ORDER BY
,LIMIT
changes the counter