One Star

Auto Increment OR ROWID

how to select highest 4 salaries from employee table in hr schema in Oracle.

In Talend how can i achieve this ?
I could take a tOracleInput(employees table) --> tSortRow(order by salary) --> but then how do i select the top 4 salaries i need to give some auto increment number to each row and then filter the table where auto increment number is less than 5.
How to use auto increment ?
OR
Is there a way where i can access ROWID of Oracle ?
3 REPLIES
One Star

Re: Auto Increment OR ROWID

Hi,
Put in your tOracleInput a SQL statement like SELECT * from EMPLOYEES ORDER BY SALARY WHERE ROWNUM<5.
One Star

Re: Auto Increment OR ROWID

Hi,
I will try to implement what u said..
But i would also like to know how to implement an auto increment number ;i want to implement a surrogate key.
One Star

Re: Auto Increment OR ROWID

Hi i could nor give a sequence id but i just found another way to get that :
Below is a link to that video that i have created to show it :
http://www.youtube.com/watch?v=g9UpNCzm6pw