In a table, 4 person having same salary. How to get Third
person record only?
Answers were Sorted based on User's Feedback
Answer / srikanth
id sal
101 1000
102 1000
103 1000
104 1000
select id, sal from emp where rownum<=3
minus
select id, sal from emp wwhere rownum<=2;
Is This Answer Correct ? | 9 Yes | 2 No |
Answer / hardeep
We can use Rank Trx, Select "salary" as Group by port and select "Date" or "Emp_id" as Rank Port and then Filter out records with Rank=3 thru Filter Trx.
Is This Answer Correct ? | 8 Yes | 2 No |
Answer / saumyabrata
1>Use a Sequence Generator Transformation,selet Start value
= 1 and Increment By = 1.
2>Use a Filter Transformation,take the ports Person and
Salary from source qualifier and the NEXTVAL port from
Sequence Generator Transformation into it.Set the filter
condition NEXTVAL = 3.
You are done.
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / boss
How can you say which is thir record when all the salaries
are same...
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / gopi k
rownum is pseudo column, when query extracts rows rownum
will be appended to query. So where rownum = 3 condition is
a wrong one.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sanju
select * from (select salary.*,rownum r from salary where
sal=(select sal from salary group by sal having count(sal)
=4)) where r=3
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / mr.lee
id sal
101 1000
102 1000
103 1000
104 1000
Select Rn, id, Sal, From (
Select Rownum Rn, id ,Sal From Emp)
Where Rn = 3
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vaas
Hi pooja,
would rowid be 3?
can u use having clause in ur query?
pl let me know poojaa
Is This Answer Correct ? | 0 Yes | 0 No |
It can be retrieved with a simple subquery.
For example, I create a table sal with id,sal
id sal
-------
11 1000
22 1000
33 1000
44 1000
to retrieve the third column with the same salary
use the below query:
select id,sal from (select id,sal,rownum r from sal)
where r=3;
Is This Answer Correct ? | 4 Yes | 4 No |
Answer / abhishek
U can achive this by using row_number function in source
qualifer example
select col1,col2,salary,emp_id from (select
col,col2,salary,emp_id , row_number() over (partition by
salary order by emp_id )as rec_seq from table)
Where
rec_seq=3
or by rank t/r in mapping
Is This Answer Correct ? | 0 Yes | 0 No |
What is meant by a domain?
what is parameter file?
i have two sources both is oracle database . one is coming from USA database and another one is coming from U.k database .i am using source qualifier transformation to join this.as that time in session level source properties which path i need to give to retrieve that data. thanks bala 09619894486
what is the difference between repository & Intergration service
i have 2 mapings for this 2 mapings i want use only one lookupt/r how?
Explain in detail about scd type 1 through mapping.
When will u go for Dynamic Cache and Persistent Cache? Pls explain with an example?
my source contain data like this eno ename phno 100 john 9989020508 101 ram 7246599999 i want to load the data into target is eno name phno 100 john (998)-9020-508 102 ram (724)-6599-999.
what are the Methods For Creating Reusable Transformations?
I have a condition sal=100 and I created one router and in that two groups g1 and g2 in g1 Sal<=100 and g2 Sal>=100, first which condition will satisfy, and Why?
Can we write to_date(three arguments) ? Will it work ? Advance thanks
What are the types of maping wizards that r to be provided in Informatica?