I have a MySQL table with data and I'm selecting out the "rank":
SELECT (@rank:=@rank+1) AS 'value' FROM MYTable a INNER JOIN (SELECT @rank :=0) b
This returns:
VALUE
1
2
3
4
Because there are 4 rows. But I want a query that can return me the results with one extra row (i.e. n+1, where n == totalNumberRows):
VALUE
1
2
3
4
5
How would I do this?