I am trying to get a sequential number column returned with my sql query. I need this to be inside the SELECT statement because I want to nest this query in another, and the
You need to use MySQL user variables. Let us take a variable t1. Initialize it at 0. And increment it in every select value.
t1
0
SET @t1=0; SELECT @t1 := @t1+1 as row_number, my_awesome_table.* from my_awesome_table
This will do the trick.