在DolphinDB中关于rowNo的问题

我想找出表中符合一定条件的的行号。比如我有一个表:

team=1 1 1 1 1 2 2 2 2 2
id=1..5 join 2..6
x=11..20\2
t=table(team, id, x)


我想找出id=2的行号,我运行:select rowNo(id) from t where id = 2. 结果返回 0和1,不是符合预期。

有没有简单的方法来获得行号?

我现在用下面方法:

update t set rowNb: rowNo(id)
exec rowNb from t where id = 2

有没有更简单的方法?


请先 登录 后评论

1 个回答

Jason Tang - 时序数据库技术支持

t1=select rowNo(id) as rownNo,id from t
select * from t1 where id = 2

请先 登录 后评论