I am trying to return values from a query adding a column for the row position without adding an identity column. I don't want the absolute position in the table, but the position in the query result
Suppose I have a table like this
My_TBL
-----------------------
FLD_A FLD_B FLD_C
a A t
b B t
c C p
d D p
.. ..
and the select query is
select FLD_A,FLD_B from My_Tbl where FLD_C='p'
FLD_A FLD_B
-----------------------
c C
d D
What do I have in Db2 to add in my query to get each row counted in that output?
POS FLD_A FLD_B
-----------------------
1 c C
2 d D