--1
(select * , row_number() over (order by columnname) as tempcolumn
from tablename )
--2
select * , row_number() over (order by defid) as tempcolumn
from fields
where tempcolumn between 1 and 2
The first query will give the entire table with a new column added.
I need to display the result after checking the range of the tempcolumn. The second query which i tried throws an error like tempcolumn doesnot exist