I wonder how could i print a row number for sql statement where is using order.
Currently i tried ROWNUM but as i understand it works only for unsorted result set.
SELECT rownum, a.lg_id, a.full_name, a.sort_order
FROM activity_type_lang a
where a.lg_id = 'en'
order by a.full_name;
TIA
In addition to nesting the query, you can use an analytic function
Using analytic functions also makes it easier if you want to change how ties are handled. You can replace
ROW_NUMBERwith RANK orDENSE_RANK.