Select Row Index from table

Hi,

Does dremio allow some type of capability to query for the row index? Something along the lines of sql server’s select rowid from tablename

Hi @R_Dirden

Currently no, maybe you can create a view in Sqlserver or Oracle like below

create or replace view emp_view_rowid as select rowid as id,first_name, last_name from employees;

Then you can query this view through Dremio

Note: You cannot combine rowid with * , so have to select individual columns you want and need to give a mandatory alias for rowid, see screenshot attached

Balaji, I actually found that I didn’t need the row id at all. I was able to leverage the lag() funtion to analyze the previous record. Thanks for your help!!!