I need to create a view that has a column named row_num where it will be inserted the row number, just like an auto increment in a normal table.
Let\'s say I\'ve thi
Adding Row number to a query result - No View needed - One Query
SELECT country, name, price, @ID := @ID + 1 AS row_num
FROM testing,
(SELECT @ID := 0) temp
Add the following to your MySQL connectionString: Allow User Variables=True;
Don't add "Cross Join" in your query to update your @ID variable.
Caution: attempting to use this in a View results in: View's SELECT contains a variable or parameter